mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-23 10:08:00 +02:00
Fixed exhaustive switch check on payload enums with static members
This commit is contained in:
parent
a89e36248f
commit
56f0f3e4f2
1 changed files with 3 additions and 1 deletions
|
@ -4850,6 +4850,8 @@ void BfModule::Visit(BfSwitchStatement* switchStmt)
|
|||
auto fieldDef = field.GetFieldDef();
|
||||
if (fieldDef == NULL)
|
||||
continue;
|
||||
if (!fieldDef->IsEnumCaseEntry())
|
||||
continue;
|
||||
if (field.mDataIdx < 0)
|
||||
lastTagId = -field.mDataIdx - 1;
|
||||
}
|
||||
|
@ -4860,7 +4862,7 @@ void BfModule::Visit(BfSwitchStatement* switchStmt)
|
|||
for (auto& field : enumType->mFieldInstances)
|
||||
{
|
||||
auto fieldDef = field.GetFieldDef();
|
||||
if ((fieldDef != NULL) && (fieldDef->mFieldDeclaration != NULL) && (fieldDef->mFieldDeclaration->mTypeRef == NULL))
|
||||
if ((fieldDef != NULL) && (fieldDef->IsEnumCaseEntry()))
|
||||
{
|
||||
if (field.mConstIdx != -1)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue