mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Better handling of undef const expressions
This commit is contained in:
parent
071dfa8e09
commit
1a93660416
4 changed files with 42 additions and 1 deletions
|
@ -3801,6 +3801,14 @@ void BfExprEvaluator::GetLiteral(BfAstNode* refNode, const BfVariant& variant)
|
|||
case BfTypeCode_StringId:
|
||||
mResult = BfTypedValue(mModule->mBfIRBuilder->CreateConst(variant.mTypeCode, variant.mUInt64), mModule->ResolveTypeDef(mModule->mCompiler->mStringTypeDef));
|
||||
break;
|
||||
case BfTypeCode_Let:
|
||||
if (mExpectingType != NULL)
|
||||
{
|
||||
mResult = BfTypedValue(mModule->mBfIRBuilder->CreateUndefValue(mModule->mBfIRBuilder->MapType(mExpectingType)), mExpectingType);
|
||||
break;
|
||||
}
|
||||
mModule->Fail("Invalid undef literal", refNode);
|
||||
break;
|
||||
default:
|
||||
mModule->Fail("Invalid literal", refNode);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue