
Issue #20731 has been updated by hsbt (Hiroshi SHIBATA). I also have similar issues with `rss`. ``` /Users/hsbt/Documents/github.com/ruby/ruby/gems/src/rss/lib/rss/1.0.rb:81: warning: mismatched indentations at ‘else’ with ‘if’ at 79 (snip) ``` https://github.com/ruby/rss/blob/master/lib/rss/1.0.rb#L81 is seems correct for me. ---------------------------------------- Bug #20731: warning: mismatched indentations at 'when' appears with prism enabled ruby https://bugs.ruby-lang.org/issues/20731#change-109738 * Author: yahonda (Yasuo Honda) * Status: Open * ruby -v: ruby 3.4.0dev (2024-09-12T20:03:28Z master 0fc8422a05) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- ### Steps to reproduce 1. Create a `case_sample.rb` file ``` foo = :bar case foo when :bar p 'foo is :bar' when :baz # do something else # do something end ``` 2. Run this file against the latest Ruby 3.4.0dev with -w option to show warnings ``` $ ruby -w case_sample.rb ``` ### Expected behavior It should show `"foo is :bar"` without any warnings as it runs against Ruby 3.3.5 or Ruby 3.4.0dev before prism is used by default ``` $ ruby -w case_sample.rb "foo is :bar" $ ruby -v ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [x86_64-linux] $ ``` ``` $ ruby -w case_sample.rb "foo is :bar" $ ruby -v ruby 3.4.0dev (2024-09-12T17:04:10Z master f2919bd11c) [x86_64-linux] $ ``` ### Actual behavior It raises `warning: mismatched indentations at 'when' with 'case' ` warnings as follows. ``` $ ruby -w case_sample.rb case_sample.rb:3: warning: mismatched indentations at 'when' with 'case' at 2 case_sample.rb:5: warning: mismatched indentations at 'when' with 'case' at 2 "foo is :bar" $ ruby -v ruby 3.4.0dev (2024-09-12T20:03:28Z master 0fc8422a05) +PRISM [x86_64-linux] $ ``` ### Background This repro is based on the tzinfo code below. https://github.com/tzinfo/tzinfo/blob/d5893c99bbcd842af86023f02a84fac1659b30... https://github.com/tzinfo/tzinfo/blob/d5893c99bbcd842af86023f02a84fac1659b30... -- https://bugs.ruby-lang.org/