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:
parent
639bfac45b
commit
c23d44502b
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue