mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fixed invalid underlying enum type error
This commit is contained in:
parent
8623f8f7e5
commit
f85a4317fc
1 changed files with 10 additions and 2 deletions
|
@ -2927,6 +2927,9 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
{
|
||||
bool hadType = false;
|
||||
|
||||
BfAstNode* deferredErrorNode = NULL;
|
||||
char* deferredError = NULL;
|
||||
|
||||
for (auto baseTypeRef : typeDef->mBaseTypes)
|
||||
{
|
||||
SetAndRestoreValue<BfTypeReference*> prevTypeRef(mContext->mCurTypeState->mCurBaseTypeRef, baseTypeRef);
|
||||
|
@ -2946,12 +2949,14 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
}
|
||||
else
|
||||
{
|
||||
Fail("Underlying enum type already specified", baseTypeRef);
|
||||
deferredError = "Underlying enum type already specified";
|
||||
deferredErrorNode = baseTypeRef;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Fail("Invalid underlying enum type", baseTypeRef);
|
||||
deferredError = "Invalid underlying enum type";
|
||||
deferredErrorNode = baseTypeRef;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2961,6 +2966,9 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
}
|
||||
}
|
||||
|
||||
if (deferredError != NULL)
|
||||
Fail(deferredError, deferredErrorNode, true);
|
||||
|
||||
if (underlyingType == NULL)
|
||||
{
|
||||
underlyingType = GetPrimitiveType(BfTypeCode_Int64);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue