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

Provide better feedback for ambiguous adverb usage #5572

Merged
merged 1 commit into from
May 22, 2024
Merged

Provide better feedback for ambiguous adverb usage #5572

merged 1 commit into from
May 22, 2024

Conversation

ab5tract
Copy link
Collaborator

@ab5tract ab5tract commented May 19, 2024

This fixes an LTA situation:

> my %h = :1k; say 1 ~ %h<k>:exists ~ 1
===SORRY!===
MVMArray: Can't pop from an empty array

Now we throw an X::Syntax::AmbiguousAdverb exception:

> my %h = :1k; say 1 ~ %h<k>:exists ~ 1
===SORRY!=== Error while compiling -e
Cannot determine the destination for named argument: :exists
Try placing parentheses around the desired callsite to disambiguate.

This addresses R#1378 (#1378), at least for RakuAST. A sister commit will be added to the grammar in NQP.

src/Raku/Grammar.nqp Outdated Show resolved Hide resolved
This fixes an LTA situation:

    > my %h = :1k; say 1 ~ %h<k>:exists ~ 1
    ===SORRY!===
    MVMArray: Can't pop from an empty array

Now we throw an `X::Syntax::AmbiguousAdverb` exception:

    > my %h = :1k; say 1 ~ %h<k>:exists ~ 1
    ===SORRY!=== Error while compiling -e
    Cannot determine the destination for named argument: :exists
    Try placing parentheses around the desired callsite to disambiguate.

This addresses R#1378 (#1378), at least for RakuAST.
A sister commit will be added to the grammar in NQP.
@lizmat lizmat merged commit 3ce05fa into main May 22, 2024
2 of 11 checks passed
@lizmat lizmat deleted the r1378 branch May 22, 2024 19:51
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.

None yet

2 participants