1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Allow explicit bool-to-number casts

This commit is contained in:
Brian Fiete 2020-08-23 10:31:56 -07:00
parent 5c2e0d86c0
commit d4c78c0799
3 changed files with 10 additions and 8 deletions

View file

@ -10343,7 +10343,7 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
if (explicitCast)
{
if (((fromPrimType->IsIntegral()) || (fromPrimType->IsFloat())) &&
if (((fromPrimType->IsIntegral()) || (fromPrimType->IsFloat()) || (fromPrimType->IsBoolean())) &&
((toType->IsIntegral()) || (toType->IsFloat())))
allowCast = true;
}