Skip to content

Instantly share code, notes, and snippets.

@oieioi
Created May 8, 2020 14:07
Show Gist options
  • Save oieioi/01e2372bbc60d4c8b40982f14863d08f to your computer and use it in GitHub Desktop.
Save oieioi/01e2372bbc60d4c8b40982f14863d08f to your computer and use it in GitHub Desktop.
def meth(arg, **kwargs)
puts "kwargs: #{kwargs}"
end
puts '---- no warning ----'
meth(1, hoge: 1) #=> no warning
meth(1, **{ hoge: 1 }) #=> no warning
send(:meth, *[1, **{hoge: 1}]) # => NO warning
puts '---- warning ----'
meth(1, { hoge: 1 }) #=> warning
meth(*[1, { hoge: 1 }]) #=> warning
meth(*[1, **{ hoge: 1 }]) #=> warning
send(:meth, 1, {hoge: 1}) # => warning
send(:meth, *[1, {hoge: 1}]) # => warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment