diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-11-28 13:44:25 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-11-28 13:47:14 +0900 |
commit | 8b4ee5d6ba92a385eedc9235ce0a2d5618deecf0 (patch) | |
tree | cc994e8656fe3fbbdb828eb3d0ce8842731ea49e /parse.y | |
parent | 18953416def52824c46a68370c4b34f5b720ee3f (diff) |
Raise `NoMatchingPatternError` when expr `in` pat doesn't match
* `expr in pattern` should raise `NoMatchingError` when unmatched
* `expr in pattern` should return `nil`. (this is unspecified, but
this feature is experimental, at all)
[Feature #16355]
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1571,7 +1571,7 @@ expr : command_call { p->in_kwarg = !!$<num>3; /*%%%*/ - $$ = NEW_CASE3($1, NEW_IN($5, NEW_TRUE(&@5), NEW_FALSE(&@5), &@5), &@$); + $$ = NEW_CASE3($1, NEW_IN($5, 0, 0, &@5), &@$); rb_warn0L(nd_line($$), "Pattern matching is experimental, and the behavior may change in future versions of Ruby!"); /*% %*/ /*% ripper: case!($1, in!($5, Qnil, Qnil)) %*/ |