mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Fixed comptime valueless ctor
This commit is contained in:
parent
6cce0ffc25
commit
b5ddc1c24b
2 changed files with 12 additions and 6 deletions
|
@ -5149,14 +5149,14 @@ BfTypedValue CeContext::Call(CeCallSource callSource, BfModule* module, BfMethod
|
||||||
Fail("Failed to encode return argument");
|
Fail("Failed to encode return argument");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (returnType->IsComposite())
|
else if ((methodInstance->mMethodDef->mMethodType == BfMethodType_Ctor) && (thisType != NULL) && (thisType->IsValuelessType()))
|
||||||
|
{
|
||||||
|
returnValue = BfTypedValue(module->mBfIRBuilder->CreateConstAggZero(module->mBfIRBuilder->MapType(returnType, BfIRPopulateType_Identity)), thisType);
|
||||||
|
}
|
||||||
|
else if ((returnType->IsComposite()) || (returnType->IsValuelessType()))
|
||||||
{
|
{
|
||||||
returnValue = BfTypedValue(module->mBfIRBuilder->CreateConstAggZero(module->mBfIRBuilder->MapType(returnType, BfIRPopulateType_Identity)), returnType);
|
returnValue = BfTypedValue(module->mBfIRBuilder->CreateConstAggZero(module->mBfIRBuilder->MapType(returnType, BfIRPopulateType_Identity)), returnType);
|
||||||
}
|
}
|
||||||
else if (returnType->IsValuelessType())
|
|
||||||
{
|
|
||||||
returnValue = BfTypedValue(module->mBfIRBuilder->GetFakeVal(), returnType);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mCallStack.Clear();
|
mCallStack.Clear();
|
||||||
|
|
|
@ -32,6 +32,12 @@ namespace Tests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct ZeroStruct
|
||||||
|
{
|
||||||
|
public this() { }
|
||||||
|
public const ZeroStruct ConstValue = ZeroStruct();
|
||||||
|
}
|
||||||
|
|
||||||
const String cStrA = "Abc";
|
const String cStrA = "Abc";
|
||||||
const String cStrB = GetStringA(cStrA, 12, 23);
|
const String cStrB = GetStringA(cStrA, 12, 23);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue