mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed enum ToString when it contains other const fields
This commit is contained in:
parent
234aaa772c
commit
f3c17a671c
1 changed files with 5 additions and 0 deletions
|
@ -16867,6 +16867,11 @@ void BfModule::EmitEnumToStringBody()
|
|||
if (fieldInstance.mConstIdx == -1)
|
||||
continue;
|
||||
|
||||
// Only allow compact 'ValA, ValB' enum declaration fields through
|
||||
auto fieldDecl = fieldInstance.GetFieldDef()->mFieldDeclaration;
|
||||
if ((fieldDecl == NULL) || (fieldDecl->mTypeRef != NULL))
|
||||
continue;
|
||||
|
||||
auto constant = mCurTypeInstance->mConstHolder->GetConstantById(fieldInstance.mConstIdx);
|
||||
if (!handledCases.TryAdd(constant->mInt64, NULL))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue