mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 18:52:07 +00:00
X && 0 and X & 0 are constant 0; X || 1 is constant 1 (#1399)
Fixes #977
This commit is contained in:
@@ -6,7 +6,7 @@ MACRO test_expr
|
||||
|
||||
DEF IS_CONST = ISCONST(\1)
|
||||
PRINTLN "Test #{d:TEST_NUM}: ISCONST reports {IS_CONST}"
|
||||
IF (\1) || 1 ; Only test if the expression can be evaluated
|
||||
IF (\1) || IS_CONST ; Only test if the expression can be evaluated
|
||||
WARN "Test #{d:TEST_NUM}: Compile-time constant"
|
||||
ENDC
|
||||
ENDM
|
||||
|
||||
Reference in New Issue
Block a user