mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Type deconstification
This commit is contained in:
parent
701cb15349
commit
41f7fd57e6
1 changed files with 13 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue