File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -807,6 +807,15 @@ closure arguments (represented by the _PatternNoTopAlt_ production).
807807 potential factors in ` c ` , is defined as being the same as that of
808808 ` c(p, ..rest) | c(q, ..rest) ` .
809809
810+ ### Precedence with other undelimited patterns
811+
812+ As shown elsewhere in this chapter, there are several types of patterns that
813+ are syntactically undelimited, including identifier patterns, reference
814+ patterns, and or-patterns. Or-patterns always have the lowest-precedence. This
815+ allows us to reserve syntactic space for a possible future type ascription
816+ feature and also to reduce ambiguity. For example, ` x @ A(..) | B(..) ` will
817+ result in an error that ` x ` is not bound in all patterns, ` &A(x) | B(x) ` will
818+ result in a type mismatch between ` x ` in the different subpatterns.
810819
811820[ _GroupedPattern_ ] : #grouped-patterns
812821[ _IdentifierPattern_ ] : #identifier-patterns
You can’t perform that action at this time.
0 commit comments