mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Properly return undef const for let case in GetLiteral
This commit is contained in:
parent
6a321b12e1
commit
9062662ffb
2 changed files with 3 additions and 1 deletions
|
@ -4022,7 +4022,7 @@ void BfExprEvaluator::GetLiteral(BfAstNode* refNode, const BfVariant& variant)
|
|||
case BfTypeCode_Let:
|
||||
if (mExpectingType != NULL)
|
||||
{
|
||||
mResult = BfTypedValue(mModule->mBfIRBuilder->CreateUndefValue(mModule->mBfIRBuilder->MapType(mExpectingType)), mExpectingType);
|
||||
mResult = BfTypedValue(mModule->mBfIRBuilder->GetUndefConstValue(mModule->mBfIRBuilder->MapType(mExpectingType)), mExpectingType);
|
||||
break;
|
||||
}
|
||||
mModule->Fail("Invalid undef literal", refNode);
|
||||
|
|
|
@ -19129,6 +19129,8 @@ void BfModule::ProcessMethod_SetupParams(BfMethodInstance* methodInstance, BfTyp
|
|||
auto genericParamInst = unspecializedMethodInstance->mMethodInfoEx->mGenericParams[genericParamType->mGenericParamIdx];
|
||||
if (genericParamInst->mTypeConstraint != NULL)
|
||||
{
|
||||
SetAndRestoreValue<bool> prevIgnoreWrites(mBfIRBuilder->mIgnoreWrites, true);
|
||||
|
||||
BfExprEvaluator exprEvaluator(this);
|
||||
exprEvaluator.mExpectingType = genericParamInst->mTypeConstraint;
|
||||
exprEvaluator.GetLiteral(NULL, constExprValueType->mValue);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue