Skip to content

Constructor (de)application as higher precedence than @ #3532

Description

@Unisay
data X = X | Y

ok :: X -> X -> X
ok x@(X) _ = X

err1 :: X -> X -> X
err1 x@X _ = X -- X was given 1 argument but expected 0 arguments

err2 :: X -> X -> X
err2 x@X _ = X -- argument list differs
err2 Y _ = Y

@natefaubion: Yeah, I’d consider that a bug
it treats constructor (de)application as higher precedence than @, which is wrong (edited)

Activity

  1. natefaubion commented on Feb 7, 2019

    @natefaubion
    Contributor

    Relates to #3517

  2. paf31 commented on Feb 7, 2019

    @paf31
    Contributor

    Matches ghc?

    Prelude> f x@Just y = y
    
    <interactive>:3:5: error:
        • The constructor ‘Just’ should have 1 argument, but has been given none
        • In the pattern: Just
          In an equation for ‘f’: f x@Just y = y
    

    Edit: never mind, that's definitely wrong, sorry.

  3. added this to the 0.13.0 milestone on Feb 24, 2019
  4. added a commit that references this issue on May 8, 2019
    c85c3b1
  5. added a commit that references this issue on May 8, 2019
    ffd0731
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions