
Issue #20675 has been updated by bkuhlmann (Brooke Kuhlmann). I think this would be *great* and would *love* to use keyword parameters without parenthesis...but I don't know how complicated this would be for the parser (including backwards compatibility which Jeremy (Evans) has mentioned before). If this were made possible -- there is an upside -- as anonymous blocks would also benefit from this support as this is not valid syntax (currently): ``` ruby def demo positional, &block other positional, &block end ``` 💡 For more on this, see [Issue 18441](https://bugs.ruby-lang.org/issues/18441). ---------------------------------------- Bug #20675: Parse error with required kwargs and omitted parens https://bugs.ruby-lang.org/issues/20675#change-109405 * 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/