From: merch-redmine@... Date: 2021-01-19T15:28:24+00:00 Subject: [ruby-core:102166] [Ruby master Bug#17560] Does `Module#ruby2_keywords` return `nil` or `self`? Issue #17560 has been updated by jeremyevans0 (Jeremy Evans). zverok (Victor Shepelev) wrote in #note-4: > Shouldn't it actually return method's name?.. For things like > > ```ruby > private ruby2_keywords def my_method > # .... > end > ``` > ?.. That was not my intention, though I don't object to it if someone else wants to make that change. Note that it would have to return an array of symbols, not a single symbol, since `ruby2_keywords` accepts arbitrary arguments. Also, it raises the question whether `ruby2_keywords` should include a method symbol if it doesn't mark the method and issues a warning instead. ---------------------------------------- Bug #17560: Does `Module#ruby2_keywords` return `nil` or `self`? https://bugs.ruby-lang.org/issues/17560#change-90016 * Author: nobu (Nobuyoshi Nakada) * Status: Assigned * Priority: Normal * Assignee: jeremyevans0 (Jeremy Evans) * Backport: 2.5: DONTNEED, 2.6: DONTNEED, 2.7: REQUIRED, 3.0: REQUIRED ---------------------------------------- The RDoc says that it returns `self`: ``` ruby2_keywords(method_name, ...) -> self ``` This seems consistent with other methods which accept method names, e.g., `public`, `private`, etc. But it actually returns `nil`, and `TestKeywordArguments#test_ruby2_keywords` also has 2 `assert_nil`s. Which is intentional? [patch to fix code as the doc](https://github.com/ruby/ruby/pull/4097) -- https://bugs.ruby-lang.org/ Unsubscribe: