1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Continue searching in CastToValue constraint check on method return fail

This commit is contained in:
Brian Fiete 2022-06-22 10:18:24 -07:00
parent abd511a93d
commit e4cac2ca24

View file

@ -13764,7 +13764,11 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
{ {
auto result = BfTypedValue(mBfIRBuilder->GetFakeVal(), operatorConstraintReturnType); auto result = BfTypedValue(mBfIRBuilder->GetFakeVal(), operatorConstraintReturnType);
if (result.mType != toType) if (result.mType != toType)
return CastToValue(srcNode, result, toType, (BfCastFlags)(castFlags | BfCastFlags_Explicit | BfCastFlags_NoConversionOperator), resultFlags); {
auto castedResult = CastToValue(srcNode, result, toType, (BfCastFlags)(castFlags | BfCastFlags_Explicit | BfCastFlags_NoConversionOperator), resultFlags);
if (castedResult)
return castedResult;
}
if (result) if (result)
return result.mValue; return result.mValue;
} }