dplassgit / d2lang

D2 is a strongly-typed, statically-typed, (mostly) inferred-type compiled language.
MIT License
5 stars 1 forks source link

Wrong operator precedence? #320

Closed dplassgit closed 6 months ago

dplassgit commented 6 months ago

This line is giving an error:

if right & 1 == 1 {

Type error at line 19, column 8: Incompatible types for operator &; left operand is INT but right is BOOL
Type error at line 19, column 8: Cannot use INT expression in IF or ELIF; must be BOOL
dplassgit commented 6 months ago

This is the same as in Java, which says "The operator & is undefined for the argument type(s) int, boolean"

This is WAI.