mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fixed non-const 'this' check in const invocations
This commit is contained in:
parent
4c553ee9a3
commit
7aa2fdf976
2 changed files with 6 additions and 2 deletions
|
@ -4911,7 +4911,11 @@ BfTypedValue CeContext::Call(CeCallSource callSource, BfModule* module, BfMethod
|
|||
|
||||
if (!isConst)
|
||||
{
|
||||
if ((argIdx != thisArgIdx) && (argIdx != appendAllocIdx))
|
||||
if ((argIdx == thisArgIdx) && (methodInstance->mMethodDef->mMethodType == BfMethodType_Ctor))
|
||||
{
|
||||
// Allow non-const 'this' for ctor
|
||||
}
|
||||
else if (argIdx != appendAllocIdx)
|
||||
{
|
||||
Fail(StrFormat("Non-constant argument for param '%s'", methodInstance->GetParamName(paramIdx).c_str()));
|
||||
return BfTypedValue();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue