|
@@ -4858,8 +4858,7 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|
if (typeInstance->IsInterface())
|
|
if (typeInstance->IsInterface())
|
|
Fail("Interfaces cannot include fields. Consider making this a property", field->GetRefNode());
|
|
Fail("Interfaces cannot include fields. Consider making this a property", field->GetRefNode());
|
|
}
|
|
}
|
|
-
|
|
|
|
- int enumCaseEntryIdx = 0;
|
|
|
|
|
|
+
|
|
for (int pass = 0; pass < 2; pass++)
|
|
for (int pass = 0; pass < 2; pass++)
|
|
{
|
|
{
|
|
for (auto field : typeDef->mFields)
|
|
for (auto field : typeDef->mFields)
|
|
@@ -4889,7 +4888,6 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|
{
|
|
{
|
|
if (typeInstance->IsEnum())
|
|
if (typeInstance->IsEnum())
|
|
{
|
|
{
|
|
- fieldInstance->mDataIdx = -(enumCaseEntryIdx++) - 1;
|
|
|
|
resolvedFieldType = typeInstance;
|
|
resolvedFieldType = typeInstance;
|
|
|
|
|
|
BfType* payloadType = NULL;
|
|
BfType* payloadType = NULL;
|
|
@@ -4983,6 +4981,23 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Assign enum indices
|
|
|
|
+ int enumCaseEntryIdx = 0;
|
|
|
|
+ for (auto field : typeDef->mFields)
|
|
|
|
+ {
|
|
|
|
+ auto fieldInstance = &typeInstance->mFieldInstances[field->mIdx];
|
|
|
|
+ if (!fieldInstance->mFieldIncluded)
|
|
|
|
+ continue;
|
|
|
|
+
|
|
|
|
+ if (field->IsEnumCaseEntry())
|
|
|
|
+ {
|
|
|
|
+ if (typeInstance->IsEnum())
|
|
|
|
+ {
|
|
|
|
+ fieldInstance->mDataIdx = -(enumCaseEntryIdx++) - 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if (!resolvedTypeRef->IsIncomplete())
|
|
if (!resolvedTypeRef->IsIncomplete())
|
|
{
|
|
{
|
|
// We finished resolving ourselves through a re-entry, so we're actually done here
|
|
// We finished resolving ourselves through a re-entry, so we're actually done here
|