1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Const resolve enum case cast fix

This commit is contained in:
Brian Fiete 2025-01-23 07:29:50 -08:00
parent f830e23c52
commit 53f4e8955e
4 changed files with 17 additions and 2 deletions

View file

@ -4679,6 +4679,10 @@ BfTypedValue BfModule::GetFieldInitializerValue(BfFieldInstance* fieldInstance,
// auto-created underlying type and it will cause an 'error flash'. We defer errors until the full resolve for that purpose
resolveFlags = BfConstResolveFlag_NoCast;
}
if ((mCurTypeInstance->IsEnum()) && (fieldDef->IsEnumCaseEntry()))
resolveFlags = (BfConstResolveFlags)(resolveFlags | BfConstResolveFlag_NoConversionOperator | BfConstResolveFlag_ExplicitCast);
UpdateSrcPos(initializer);
auto result = constResolver.Resolve(initializer, fieldType, resolveFlags);
if ((mCompiler->mCeMachine != NULL) && (fieldInstance != NULL))