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:
parent
5c2e0d86c0
commit
d4c78c0799
3 changed files with 10 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue