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

More improvements to conversion operator overloading on typed primitive

This commit is contained in:
Brian Fiete 2022-01-21 07:14:45 -05:00
parent e0077fd4ef
commit 0de32f7b34
2 changed files with 28 additions and 15 deletions

View file

@ -12812,7 +12812,7 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
if ((underlyingCanCast) &&
(!returnCanCast))
{
{
doCall = false;
}
else if ((returnCanCast) &&
@ -12820,11 +12820,13 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
{
// Can do
}
else if ((!CanCast(GetFakeTypedValue(underlyingType), returnType, implicitCastFlags)) &&
(CanCast(GetFakeTypedValue(returnType), underlyingType, implicitCastFlags)))
{
doCall = false;
}
else if ((CanCast(GetFakeTypedValue(underlyingType), returnType, implicitCastFlags)) &&
(!CanCast(GetFakeTypedValue(returnType), underlyingType, implicitCastFlags)))
{
// Can do
}
else
doCall = false;
}
}
@ -12844,15 +12846,17 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
doCall = false;
}
else if ((paramCanCast) &&
(!underlyingType))
(!underlyingCanCast))
{
doCall = true;
// Can do
}
else if ((!CanCast(GetFakeTypedValue(underlyingType), paramType, implicitCastFlags)) &&
(CanCast(GetFakeTypedValue(paramType), underlyingType, implicitCastFlags)))
else if ((CanCast(GetFakeTypedValue(underlyingType), paramType, implicitCastFlags)) &&
(!CanCast(GetFakeTypedValue(paramType), underlyingType, implicitCastFlags)))
{
// Can do
}
else
doCall = false;
}
}
}