
Issue #20675 has been updated by ko1 (Koichi Sasada). Dan0042 (Daniel DeLorme) wrote in #note-4:
I believe Matz was talking about changing the behavior of `f k:<newline>`, so method definition `def foo k:<newline>` would remain the same.
Although `f k:<newline>expr` would be incompatible, what about `f(k:<newline>expr)` ?
for `f k:<newline>val`, I found about 500 cases. https://gist.github.com/ko1/e15fd4959675db07188e7a67ddc1c2c6 ---------------------------------------- Bug #20675: Parse error with required kwargs and omitted parens https://bugs.ruby-lang.org/issues/20675#change-109433 * Author: matz (Yukihiro Matsumoto) * Status: Open * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- As pointed out in https://github.com/mruby/mruby/issues/6268, keyword arguments without surrounding parens are a bit confusing, e.g. ```ruby def foo arg: 123 end ``` is parsed as ```ruby def foo(arg:) 123 end ``` where ```ruby k=25 f k: 10 ``` is parserd as ```ruby k=25 f(k: 10) ``` In summary, should we ignore newlines after keyword labels? Should we make them behave consistent? Matz. -- https://bugs.ruby-lang.org/