errors and warnings / parsing / E0110
E0110 error
?? mixed with and/or without parentheses
- area
- parsing (x01xx)
- fails the build
- yes
?? is mixed with and or or in one expression without parentheses, as
in a ?? b or c. They have the same precedence, and the reading isn't
obvious (?? keeps false, or doesn't), so wowlua asks for parentheses, as
JavaScript does. Add them around the part that should go first.
Example
local saved: boolean? = nillocal fallback = trueprint(saved ?? fallback or false)local saved: boolean? = nillocal fallback = trueprint((saved ?? fallback) or false)The compiler reports it like this:
error[E0110]: `??` cannot be mixed with `and`/`or` without parentheses ┌─ src/main.wowlua:3:25 │ 3 │ print(saved ?? fallback or false) │ ^^ here
Offline
$ wowlua explain E0110 E0110 (error): ?? mixed with and/or without parentheses