From: shevegen@... Date: 2019-08-19T16:45:01+00:00 Subject: [ruby-core:94437] [Ruby master Bug#16111] Combining default positional and keyword arguments is resulting in a `to_hash` method call Issue #16111 has been updated by shevegen (Robert A. Heiler). I think that either way, resolving it may not be trivial/simple right now; if you look at mame's linked in issue above at #14183, it mentions 19 (somewhat) related issues concerning keyword arguments. Jeremy also pointed out some bugs prior to this, and if I remember correctly, matz spoke about the somewhat confusing situation in a presentation a while ago. This may need to be given some time, for the time being, but the ruby core team is most likely aware of the situation. I personally have avoided keyword arguments so far (but unrelated to the issues mentioned in the issue trackers; I mostly stick to oldschool hashes. Perhaps this may also be somewhat of a "historic" nature, in that hash-behaviour came first (the old pickaxe mentioned that, e. g. you could drop the {} syntax for the last arguments in a method if it was a hash), and at a later time keyword arguments were added. If I remember correctly then matz has also mention that the situation with keyword arguments may be one of the very very few incompatibilities for ruby 3.0 (perhaps), so I guess it is not out of the question to see a change in behaviour in this regard. As mame has pointed out, one of the biggest concern, if not the biggest, is the incompatibility issue. ---------------------------------------- Bug #16111: Combining default positional and keyword arguments is resulting in a `to_hash` method call https://bugs.ruby-lang.org/issues/16111#change-80862 * Author: mtelford (Michael Telford) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: 2.6.3 * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- Combining default positional and keyword arguments is resulting in a `to_hash` method call when I don't believe it should be. It's affecting some code I am writing. The full details of the behaviour I'm describing can be seen in the attached script. I would like to know why the method `to_hash` is being called (only in certain circumstances) and if this is a bug to be fixed or desired behaviour (and why?). Thank in advance! ---Files-------------------------------- ruby-bug.rb (1.44 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: