mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed const handling
This commit is contained in:
parent
395cac905d
commit
67556c2ff6
1 changed files with 18 additions and 15 deletions
|
@ -3615,8 +3615,7 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
}
|
||||
}
|
||||
|
||||
// Check enum cases for duplicates
|
||||
if (mCurTypeInstance->IsEnum())
|
||||
// Const handling
|
||||
{
|
||||
Dictionary<int64, BfFieldDef*> valueMap;
|
||||
for (auto& fieldInstanceRef : typeInstance->mFieldInstances)
|
||||
|
@ -3632,6 +3631,9 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
SetAndRestoreValue<BfFieldDef*> prevTypeRef(mContext->mCurTypeState->mCurFieldDef, fieldDef);
|
||||
typeInstance->mModule->ResolveConstField(typeInstance, fieldInstance, fieldDef);
|
||||
|
||||
// Check enum cases for duplicates
|
||||
if (mCurTypeInstance->IsEnum())
|
||||
{
|
||||
auto underlyingType = fieldInstance->mResolvedType->GetUnderlyingType();
|
||||
if ((fieldDef->IsEnumCaseEntry()) && (fieldInstance->mConstIdx != -1) && (underlyingType->IsIntegral()))
|
||||
{
|
||||
|
@ -3651,6 +3653,7 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((typeInstance->IsEnum()) && (!typeInstance->IsPayloadEnum()))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue