mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed cast constraint check for IOpConvertibleTo
This commit is contained in:
parent
fb7251e71a
commit
3a7b7e559b
1 changed files with 4 additions and 7 deletions
|
@ -9902,18 +9902,15 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
|
||||||
{
|
{
|
||||||
auto castedVal = CastToValue(srcNode, typedVal, toType->GetUnderlyingType(), (BfCastFlags)(castFlags & ~BfCastFlags_Explicit), NULL);
|
auto castedVal = CastToValue(srcNode, typedVal, toType->GetUnderlyingType(), (BfCastFlags)(castFlags & ~BfCastFlags_Explicit), NULL);
|
||||||
return castedVal;
|
return castedVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cannot cast (was error)
|
|
||||||
return BfIRValue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actually perform conversion
|
// Actually perform conversion
|
||||||
BfExprEvaluator exprEvaluator(this);
|
BfExprEvaluator exprEvaluator(this);
|
||||||
auto castedFromValue = Cast(srcNode, typedVal, bestFromType, castFlags);
|
auto castedFromValue = Cast(srcNode, typedVal, bestFromType, castFlags);
|
||||||
if (!castedFromValue)
|
if (!castedFromValue)
|
||||||
return BfIRValue();
|
return BfIRValue();
|
||||||
|
|
||||||
BfTypedValue operatorOut;
|
BfTypedValue operatorOut;
|
||||||
if (ignoreWrites)
|
if (ignoreWrites)
|
||||||
{
|
{
|
||||||
|
@ -9935,7 +9932,7 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return CastToValue(srcNode, operatorOut, toType, castFlags, resultFlags);
|
return CastToValue(srcNode, operatorOut, toType, castFlags, resultFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue