1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Type deconstification

This commit is contained in:
Brian Fiete 2021-10-30 21:41:10 -07:00
parent 701cb15349
commit 41f7fd57e6

View file

@ -3050,6 +3050,19 @@ void BfExprEvaluator::Evaluate(BfAstNode* astNode, bool propogateNullConditional
if ((mBfEvalExprFlags & BfEvalExprFlags_AllowIntUnknown) == 0)
mModule->FixIntUnknown(mResult);
if (!mModule->mBfIRBuilder->mIgnoreWrites)
{
if (mResult.mValue.IsConst())
{
auto constant = mModule->mBfIRBuilder->GetConstant(mResult.mValue);
if (constant->mConstType == BfConstType_TypeOf)
{
auto typeOfConst = (BfTypeOf_Const*)constant;
mResult.mValue = mModule->CreateTypeDataRef(typeOfConst->mType);
}
}
}
if (mModule->mCurMethodState != NULL)
{
if (mInsidePendingNullable)