mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Error on missing enum payload args
This commit is contained in:
parent
7e36f374e1
commit
699243e3e0
1 changed files with 12 additions and 13 deletions
|
@ -4564,19 +4564,18 @@ BfTypedValue BfExprEvaluator::LookupField(BfAstNode* targetSrc, BfTypedValue tar
|
||||||
}
|
}
|
||||||
mModule->PopulateType(fieldInstance->mOwner, BfPopulateType_Data);
|
mModule->PopulateType(fieldInstance->mOwner, BfPopulateType_Data);
|
||||||
|
|
||||||
// OLD:
|
if (auto fieldTypeInstance = fieldInstance->mResolvedType->ToTypeInstance())
|
||||||
// auto agg = mModule->CreateAlloca(fieldInstance->mOwner);
|
{
|
||||||
// auto gep = mModule->mBfIRBuilder->CreateInBoundsGEP(agg, 0, 2);
|
bool hasFields = false;
|
||||||
// mModule->mBfIRBuilder->CreateStore(mModule->mBfIRBuilder->CreateConst(dscrType->mTypeDef->mTypeCode, tagIdx), gep);
|
for (auto& fieldInstance : fieldTypeInstance->mFieldInstances)
|
||||||
//
|
{
|
||||||
// if (fieldInstance->mResolvedType->mSize != 0)
|
if (!fieldInstance.mResolvedType->IsVoid())
|
||||||
// {
|
hasFields = true;
|
||||||
// mModule->FailAfter("Enum case parameters expected", targetSrc);
|
}
|
||||||
// }
|
if (hasFields)
|
||||||
//
|
mModule->FailAfter("Enum payload arguments expected", targetSrc);
|
||||||
// return BfTypedValue(agg, fieldInstance->mOwner, true);
|
}
|
||||||
|
|
||||||
//NEW
|
|
||||||
SizedArray<BfIRValue, 3> values;
|
SizedArray<BfIRValue, 3> values;
|
||||||
values.Add(mModule->mBfIRBuilder->CreateConstAggZero(mModule->mBfIRBuilder->MapType(curCheckType->mBaseType)));
|
values.Add(mModule->mBfIRBuilder->CreateConstAggZero(mModule->mBfIRBuilder->MapType(curCheckType->mBaseType)));
|
||||||
values.Add(mModule->mBfIRBuilder->CreateConstAggZero(mModule->mBfIRBuilder->MapType(curCheckType->GetUnionInnerType())));
|
values.Add(mModule->mBfIRBuilder->CreateConstAggZero(mModule->mBfIRBuilder->MapType(curCheckType->GetUnionInnerType())));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue