Skip to content

Delete redundant examples #2198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ deprecated, and conversion will be removed in Ruby 3. [[Feature #14183]](https:
def foo(h={}, key: 42); end; foo("key" => 43, key: 42) # warned
def foo(h={}, key: 42); end; foo({"key" => 43, key: 42}) # warned
def foo(h={}, key: 42); end; foo({"key" => 43}, key: 42) # OK
def foo(h={}, key: 42); end; foo({"key" => 43}, key: 42) # OK
```

* If a method does not accept keywords, and is called with keywords,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ Ruby に添付されている REPL (Read-Eval-Print-Loop) である `irb` で、
def foo(h={}, key: 42); end; foo("key" => 43, key: 42) # warned
def foo(h={}, key: 42); end; foo({"key" => 43, key: 42}) # warned
def foo(h={}, key: 42); end; foo({"key" => 43}, key: 42) # OK
def foo(h={}, key: 42); end; foo({"key" => 43}, key: 42) # OK
```

* メソッドがキーワード引数を受け取らず、呼び出し側でキーワード引数を渡した場合、ハッシュの引数としてみなされる挙動は変わらず、警告も表示されません。Ruby 3でもこのコードは動き続ける予定です。
Expand Down