diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2025-12-05 18:54:43 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2026-02-04 13:28:33 +0900 |
| commit | 4f360107387c47bfd82e7010b8eb7393575d4d76 (patch) | |
| tree | bf3c28f59ac7281d6d8835f4347f17b82bd55fe6 /test/ruby | |
| parent | c8b2a453d0fe099064e095d165ce38ee8c3eef38 (diff) | |
[Bug #21669] Fix void value expression check for `rescue`-else
If `rescue`-else node is void, the `rescue`-body is also void.
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_syntax.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 79e373ea66..9a14375056 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -2040,6 +2040,17 @@ eom return end }; + + assert_syntax_error("#{<<~"{#"}\n#{<<~'};'}", /void value expression/, nil, "#{BUG_21669} 1.2") + {# + x = begin + foo + rescue + return + else + return + end + }; end def test_tautological_condition |
