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

Fixed recursive constraint check in casting

This commit is contained in:
Brian Fiete 2022-01-29 12:09:20 -05:00
parent 639bfac45b
commit c23d44502b

View file

@ -11917,6 +11917,9 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
return mBfIRBuilder->GetFakeVal();
}
if ((genericParamInst->mTypeConstraint == toType) && (toType->IsUnspecializedType()))
return mBfIRBuilder->GetFakeVal();
auto castedVal = CastToValue(srcNode, typedVal, genericParamInst->mTypeConstraint, (BfCastFlags)(castFlags | BfCastFlags_SilentFail));
if (castedVal)
return castedVal;