better error for mistakely doing &&
instead of and
#1877
Labels
contributor friendly
This issue is limited in scope and/or knowledge of Zig internals.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
Milestone
Here's an example use case thanks to @vegecode:
The error you get is:
Which is not at all clear what's actually happening: that the programmer accidentally used
&&
instead ofand
.I believe that
&
followed by another&
would never be valid semantically, so the parser can reject this and say "did you meanand
?"The text was updated successfully, but these errors were encountered: