1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fixed allowRef for default values for failed local var inits

This commit is contained in:
Brian Fiete 2022-02-05 11:26:58 -05:00
parent 2130715f21
commit faefc68cc0

View file

@ -1737,12 +1737,12 @@ BfLocalVariable* BfModule::HandleVariableDeclaration(BfVariableDeclaration* varD
if (isConst)
{
Fail("Const locals must be initialized", varDecl->mModSpecifier);
initValue = GetDefaultTypedValue(resolvedType);
initValue = GetDefaultTypedValue(resolvedType, true);
}
else if (isReadOnly)
{
Fail("Readonly locals must be initialized", varDecl->mModSpecifier);
initValue = GetDefaultTypedValue(resolvedType);
initValue = GetDefaultTypedValue(resolvedType, true);
}
else if (auto refTypeRef = BfNodeDynCast<BfRefTypeRef>(varDecl->mTypeRef))
{