Skip to content
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

Fix ambiguity warning #2

Merged
merged 1 commit into from
Sep 29, 2023
Merged

Fix ambiguity warning #2

merged 1 commit into from
Sep 29, 2023

Conversation

rubas
Copy link
Contributor

@rubas rubas commented Sep 29, 2023

warning: missing parentheses for expression following "do:" keyword. Parentheses are required to solve ambiguity inside keywords.

This error happens when you have function calls without parentheses inside keywords. For example:

    function(arg, one: nested_call a, b, c)
    function(arg, one: if expr, do: :this, else: :that)

In the examples above, we don't know if the arguments "b" and "c" apply to the function "function" or "nested_call". Or if the keywords "do" and "else" apply to the function "function" or "if". You can solve this by explicitly adding parentheses:

    function(arg, one: if(expr, do: :this, else: :that))
    function(arg, one: nested_call(a, b, c))

Ambiguity found at:
  lib/cldr_strftime.ex:102

@kipcole9 kipcole9 merged commit 834cfe4 into elixir-cldr:main Sep 29, 2023
@kipcole9
Copy link
Contributor

Thank you sir, much appreciated. Will publish a new version right away.

🥳🥳🥳🥳🥳

kipcole9 added a commit that referenced this pull request Sep 29, 2023
@kipcole9
Copy link
Contributor

I've published ex_cldr_strftime version 1.0.1 with the following changelog entry:

Bug Fixes

Interestingly I had made exactly the same change in my local repo and had never published it. Thanks again!

@rubas rubas deleted the patch-1 branch September 30, 2023 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants