mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-16 15:24:10 +02:00
Fixed explicit boxing of generic param
This commit is contained in:
parent
b7e5d3fda5
commit
d9ba98486e
1 changed files with 5 additions and 1 deletions
|
@ -15139,6 +15139,7 @@ void BfExprEvaluator::Visit(BfBoxExpression* boxExpr)
|
||||||
{
|
{
|
||||||
bool doFail = false;
|
bool doFail = false;
|
||||||
bool doWarn = false;
|
bool doWarn = false;
|
||||||
|
BfType* boxedType = NULL;
|
||||||
|
|
||||||
if (exprValue.mType->IsGenericParam())
|
if (exprValue.mType->IsGenericParam())
|
||||||
{
|
{
|
||||||
|
@ -15152,6 +15153,8 @@ void BfExprEvaluator::Visit(BfBoxExpression* boxExpr)
|
||||||
|
|
||||||
if ((genericParamInstance->mTypeConstraint != NULL) && (genericParamInstance->mTypeConstraint->IsObjectOrInterface()))
|
if ((genericParamInstance->mTypeConstraint != NULL) && (genericParamInstance->mTypeConstraint->IsObjectOrInterface()))
|
||||||
doWarn = true;
|
doWarn = true;
|
||||||
|
|
||||||
|
boxedType = mModule->mContext->mBfObjectType;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -15172,7 +15175,8 @@ void BfExprEvaluator::Visit(BfBoxExpression* boxExpr)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BfType* boxedType = mModule->CreateBoxedType(exprValue.mType);
|
if (boxedType == NULL)
|
||||||
|
boxedType = mModule->CreateBoxedType(exprValue.mType);
|
||||||
if (boxedType == NULL)
|
if (boxedType == NULL)
|
||||||
boxedType = mModule->mContext->mBfObjectType;
|
boxedType = mModule->mContext->mBfObjectType;
|
||||||
mResult = mModule->BoxValue(boxExpr->mExpression, exprValue, boxedType, allocTarget);
|
mResult = mModule->BoxValue(boxExpr->mExpression, exprValue, boxedType, allocTarget);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue