diff --git a/Cpp2IL.Core/Model/Contexts/TypeAnalysisContext.cs b/Cpp2IL.Core/Model/Contexts/TypeAnalysisContext.cs index a3173e81..f526d4d4 100644 --- a/Cpp2IL.Core/Model/Contexts/TypeAnalysisContext.cs +++ b/Cpp2IL.Core/Model/Contexts/TypeAnalysisContext.cs @@ -89,7 +89,15 @@ public TypeAnalysisContext? BaseType public TypeAnalysisContext? DeclaringType { get; protected internal set; } - public TypeAnalysisContext? EnumUnderlyingType => Definition == null ? null : AppContext.ResolveIl2CppType(Definition.EnumUnderlyingType); + public TypeAnalysisContext? OverrideEnumUnderlyingType { get; set; } + + public TypeAnalysisContext? EnumUnderlyingType + { + get => OverrideEnumUnderlyingType ?? DefaultEnumUnderlyingType; + set => OverrideEnumUnderlyingType = value; + } + + public TypeAnalysisContext? DefaultEnumUnderlyingType => Definition == null ? null : AppContext.ResolveIl2CppType(Definition.EnumUnderlyingType); private List? _interfaceContexts; public List InterfaceContexts