Skip to content

Commit be09503

Browse files
committed
clarify precedence of if relative to |
1 parent a84f01b commit be09503

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

text/3637-guard-patterns.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ false if (foo | true)
9090
```
9191

9292
For that reason, guard patterns nested within or-patterns must be explicitly parenthesized.
93+
Otherwise, the `|` will be parsed as a bitwise OR to maintain backwards compatability with match arm guards.
9394

9495
There's a similar ambiguity between `=` used as the assignment operator within the guard
9596
and used outside to indicate assignment to the pattern (e.g. in `if`-`let`, `while let`, etc.).

0 commit comments

Comments
 (0)