mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Make .Underlying always const on const enum values
This commit is contained in:
parent
c495d4434a
commit
68edae2a35
1 changed files with 9 additions and 0 deletions
|
@ -20073,7 +20073,16 @@ BfTypedValue BfExprEvaluator::GetResult(bool clearResult, bool resolveGenericTyp
|
|||
mModule->EmitObjectAccessCheck(mPropTarget);
|
||||
}
|
||||
|
||||
SetAndRestoreValue<BfEvalExprFlags> prevExprFlags(mBfEvalExprFlags);
|
||||
auto callFlags = mPropDefBypassVirtual ? BfCreateCallFlags_BypassVirtual : BfCreateCallFlags_None;
|
||||
|
||||
auto methodDef = methodInstance.mMethodInstance->mMethodDef;
|
||||
if ((methodDef->mMethodDeclaration == NULL) && (mPropTarget.mValue.IsConst()) &&
|
||||
(methodDef->mName == "get__Underlying"))
|
||||
{
|
||||
mBfEvalExprFlags = (BfEvalExprFlags)(mBfEvalExprFlags | BfEvalExprFlags_Comptime);
|
||||
}
|
||||
|
||||
mResult = CreateCall(mPropSrc, mPropTarget, mOrigPropTarget, matchedMethod, methodInstance, callFlags, mIndexerValues, NULL);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue