You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: I think that breaking with our unspoken policy of upgrading to new Ruby versions behavior not being considered a breaking change, this SHOULD be considered a breaking change and be targeted at a major version release. This change is the main reason of incompatibilies between Ruby 2.7 and 3.0 and I would say at least 50% of the code running using Opal is Opal specific (ie. not executed with Ruby). At best, we should try to match the Ruby 2.7 behavior in the 1.x lineup and warn when the last argument is a hash.
Opal version: master
The text was updated successfully, but these errors were encountered:
Idea: If we are to refactor this, shouldn't kwargs be treated similarly to how block is currently handled? I'm not a big fan of defining $$p as a property of a function though.
@hmdne I agree 100% on the release plan toward the updated behavior.
About how to implement them, I thought for a long time that Ruby could benefit from a Symbol only keys version of Hashes which should be used for kwargs as well. This would lend itself to better performance and looks like MRI is internally doing something among those lines. For us that would also mean we could use pure JS objects to represent it and have the full-fledged Hash to be a subclass of it.
Describe the bug
As of now, Opal follows Ruby <=2.6 rules regarding how **kwargs are handled. See:
We have got only a preliminary **nil support, see: #2240
We support delegation 3.0 level, see: #2153
Note: I think that breaking with our unspoken policy of upgrading to new Ruby versions behavior not being considered a breaking change, this SHOULD be considered a breaking change and be targeted at a major version release. This change is the main reason of incompatibilies between Ruby 2.7 and 3.0 and I would say at least 50% of the code running using Opal is Opal specific (ie. not executed with Ruby). At best, we should try to match the Ruby 2.7 behavior in the 1.x lineup and warn when the last argument is a hash.
Opal version: master
The text was updated successfully, but these errors were encountered: