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

Fixed boxing of generic const value constraint

This commit is contained in:
Brian Fiete 2020-12-26 05:12:14 -08:00
parent edd7005c62
commit 68e711beff

View file

@ -9996,7 +9996,7 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
// Generic param -> *
if ((typedVal.mType->IsGenericParam()) && (!toType->IsGenericParam()))
{
if (toType == mContext->mBfObjectType)
if ((typedVal.mKind != Beefy::BfTypedValueKind_GenericConstValue) && (toType == mContext->mBfObjectType))
{
// Always allow casting from generic to object
return typedVal.mValue;