diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-09-06 00:44:35 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-09-13 08:30:37 +0900 |
commit | 6e64d4370456190541705ec4c6cf3af6bf4ac647 (patch) | |
tree | 22fc51ae963a4a6059222c1ede9d0ad6b67836ea /test | |
parent | 19346c2336053b351673da030b00c704138252d8 (diff) |
[Bug #19862] Skip compiled result of never reachable expression
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8381
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_iseq.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb index 4ff808418f..0af29d9f32 100644 --- a/test/ruby/test_iseq.rb +++ b/test/ruby/test_iseq.rb @@ -770,4 +770,15 @@ class TestISeq < Test::Unit::TestCase assert_syntax_error("false and break", mesg) assert_syntax_error("if false and break; end", mesg) end + + def test_unreachable_pattern_matching + assert_in_out_err([], "#{<<~"begin;"}\n#{<<~'end;'}", %w[1]) + begin; + if true or {a: 0} in {a:} + p 1 + else + p 0 + end + end; + end end |