summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorEarlopain <14981592+Earlopain@users.noreply.github.com>2025-11-17 13:02:32 +0100
committerKevin Newton <kddnewton@gmail.com>2025-11-17 10:11:40 -0500
commitd66b37e3d8737451ae76b40823641582bd451f8f (patch)
treee8ea559b4a1a833b569e85e79af2fa4adf4244f1 /doc
parenta0ef236678c0e79d2f4ec369d3cbf2095013803b (diff)
Remove alternation pattern matching handling from the prism compiler
Since https://github.com/ruby/ruby/pull/15212 these are proper syntax errors, so no need to handle this explicitly anymore. Also updated the example in the docs for this
Diffstat (limited to 'doc')
-rw-r--r--doc/syntax/pattern_matching.rdoc2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/syntax/pattern_matching.rdoc b/doc/syntax/pattern_matching.rdoc
index c43919ba14..06aae26d49 100644
--- a/doc/syntax/pattern_matching.rdoc
+++ b/doc/syntax/pattern_matching.rdoc
@@ -253,11 +253,11 @@ The "rest" part of a pattern also can be bound to a variable:
case {a: 1, b: 2}
in {a: } | Array
+ # ^ SyntaxError (variable capture in alternative pattern)
"matched: #{a}"
else
"not matched"
end
- # SyntaxError (illegal variable in alternative pattern (a))
Variables that start with <code>_</code> are the only exclusions from this rule: