mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +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 (!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()));
|
Fail(StrFormat("Non-constant argument for param '%s'", methodInstance->GetParamName(paramIdx).c_str()));
|
||||||
return BfTypedValue();
|
return BfTypedValue();
|
||||||
|
|
|
@ -220,7 +220,7 @@ namespace Tests
|
||||||
|
|
||||||
String serializeBuffer = new .();
|
String serializeBuffer = new .();
|
||||||
|
|
||||||
Compiler.Assert(!type.IsUnion);
|
Runtime.Assert(!type.IsUnion);
|
||||||
|
|
||||||
for (let field in type.GetFields())
|
for (let field in type.GetFields())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue