-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
[ruby-2.7.0] warning: The last argument is used as the keyword parameter #500
Labels
Comments
Thank you for reporting this. Would you please be able to submit a PR that fixes this issue? |
@radar Yes I will soon |
alchimere
added a commit
to alchimere/i18n
that referenced
this issue
Nov 27, 2019
alchimere
added a commit
to alchimere/i18n
that referenced
this issue
Nov 27, 2019
I just realized nothing can be done in the method itself to "fix" this, so I added a comment that explain that. So other developers will understand faster than me. |
alchimere
added a commit
to alchimere/i18n
that referenced
this issue
Jan 4, 2020
radar
added a commit
that referenced
this issue
Jan 7, 2020
…ranslate-kwargs Add comment on kwargs to avoid new people open issues like #500
kamipo
added a commit
to kamipo/i18n
that referenced
this issue
Jan 1, 2021
Related ruby-i18n#501, ruby-i18n#500, and ruby-i18n#471. In Ruby 3.0, the behavior of `I18n.t("key", { value: "foo" })` has silently changed to `{ value: "foo" }` is no longer regarded as `**options` but regarded as noop slpat arguments `*`. https://github.com/ruby-i18n/i18n/blob/4709391dceab9096d5988576f93935843023a6ef/lib/i18n.rb#L195 So allowing (discarding) noop arguments will be more harmful in Ruby 3.0. This removes the allowing noop arguments, it makes `{ value: "foo" }` will raise ArgumentError instead of silently ignored the options.
radar
pushed a commit
that referenced
this issue
Jan 1, 2021
Related #501, #500, and #471. In Ruby 3.0, the behavior of `I18n.t("key", { value: "foo" })` has silently changed to `{ value: "foo" }` is no longer regarded as `**options` but regarded as noop slpat arguments `*`. https://github.com/ruby-i18n/i18n/blob/4709391dceab9096d5988576f93935843023a6ef/lib/i18n.rb#L195 So allowing (discarding) noop arguments will be more harmful in Ruby 3.0. This removes the allowing noop arguments, it makes `{ value: "foo" }` will raise ArgumentError instead of silently ignored the options.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What I tried to do
I tested one of my ruby project against ruby-2.7.0-preview3
What I expected to happen
To work without warnings
What actually happened
Warning because of ruby 2.7 keyword argument deprecations before ruby 3.0
Versions of i18n, rails, and anything else you think is necessary
I18n 1.7.0 (standalone)
In a standard irb console with ruby-2.7.0-preview3
The text was updated successfully, but these errors were encountered: