mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48: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);
|
||||
return castedVal;
|
||||
}
|
||||
|
||||
// Cannot cast (was error)
|
||||
return BfIRValue();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Actually perform conversion
|
||||
BfExprEvaluator exprEvaluator(this);
|
||||
auto castedFromValue = Cast(srcNode, typedVal, bestFromType, castFlags);
|
||||
if (!castedFromValue)
|
||||
return BfIRValue();
|
||||
|
||||
|
||||
BfTypedValue operatorOut;
|
||||
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