mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-12 21:34:11 +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)
|
if ((mBfEvalExprFlags & BfEvalExprFlags_AllowIntUnknown) == 0)
|
||||||
mModule->FixIntUnknown(mResult);
|
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 (mModule->mCurMethodState != NULL)
|
||||||
{
|
{
|
||||||
if (mInsidePendingNullable)
|
if (mInsidePendingNullable)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue