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:
parent
570c03f25c
commit
d48d03c58b
7 changed files with 107 additions and 28 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue