mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +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;
|
bool hadType = false;
|
||||||
|
|
||||||
|
BfAstNode* deferredErrorNode = NULL;
|
||||||
|
char* deferredError = NULL;
|
||||||
|
|
||||||
for (auto baseTypeRef : typeDef->mBaseTypes)
|
for (auto baseTypeRef : typeDef->mBaseTypes)
|
||||||
{
|
{
|
||||||
SetAndRestoreValue<BfTypeReference*> prevTypeRef(mContext->mCurTypeState->mCurBaseTypeRef, baseTypeRef);
|
SetAndRestoreValue<BfTypeReference*> prevTypeRef(mContext->mCurTypeState->mCurBaseTypeRef, baseTypeRef);
|
||||||
|
@ -2946,12 +2949,14 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Fail("Underlying enum type already specified", baseTypeRef);
|
deferredError = "Underlying enum type already specified";
|
||||||
|
deferredErrorNode = baseTypeRef;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Fail("Invalid underlying enum type", baseTypeRef);
|
deferredError = "Invalid underlying enum type";
|
||||||
|
deferredErrorNode = baseTypeRef;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2961,6 +2966,9 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (deferredError != NULL)
|
||||||
|
Fail(deferredError, deferredErrorNode, true);
|
||||||
|
|
||||||
if (underlyingType == NULL)
|
if (underlyingType == NULL)
|
||||||
{
|
{
|
||||||
underlyingType = GetPrimitiveType(BfTypeCode_Int64);
|
underlyingType = GetPrimitiveType(BfTypeCode_Int64);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue