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

Made type lookup errors 'var' instead of 'Object', less error cascading

This commit is contained in:
Brian Fiete 2019-10-04 10:38:36 -07:00
parent 570c03f25c
commit d48d03c58b
7 changed files with 107 additions and 28 deletions

View file

@ -1383,8 +1383,11 @@ BfLocalVariable* BfModule::HandleVariableDeclaration(BfVariableDeclaration* varD
}
}
}
if (!initValue)
initValue = GetDefaultTypedValue(mContext->mBfObjectType);
if (!initValue)
{
initValue = GetDefaultTypedValue(GetPrimitiveType(BfTypeCode_Var));
SetHadVarUsage();
}
if (initValue.mType->IsNull())
{
Fail("Implicitly-typed variables cannot be initialized to 'null'", varDecl->mInitializer);