mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 17:14:01 +02:00
vm_args.c: rephrase the warning message of keyword argument separation
(old) test.rb:4: warning: The last argument is used as the keyword parameter test.rb:1: warning: for `foo' defined here; maybe ** should be added to the call? (new) test.rb:4: warning: The last argument is used as keyword parameters; maybe ** should be added to the call test.rb:1: warning: The called method `foo' is defined here
This commit is contained in:
parent
2b2030f265
commit
f7aee58498
12 changed files with 357 additions and 357 deletions
|
@ -115,7 +115,7 @@ module TestStruct
|
|||
assert_equal "#{@Struct}::KeywordInitTrue(keyword_init: true)", @Struct::KeywordInitTrue.inspect
|
||||
# eval is needed to prevent the warning duplication filter
|
||||
k = eval("Class.new(@Struct::KeywordInitFalse) {def initialize(**) end}")
|
||||
assert_warn(/The last argument is used as the keyword parameter/) {k.new(a: 1, b: 2)}
|
||||
assert_warn(/The last argument is used as keyword parameters/) {k.new(a: 1, b: 2)}
|
||||
k = Class.new(@Struct::KeywordInitTrue) {def initialize(**) end}
|
||||
assert_warn('') {k.new(a: 1, b: 2)}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue