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
{{ message }}
Repository navigation
Constructor (de)application as higher precedence than @ #3532
dataX = X|Yok::X->X->X
ok x@(X) _ = Xerr1::X->X->X
err1 x@X _ = X-- X was given 1 argument but expected 0 argumentserr2::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)
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
Activity
natefaubion commentedon Feb 7, 2019
Relates to #3517
paf31 commentedon Feb 7, 2019
Matches ghc?Edit: never mind, that's definitely wrong, sorry.
Add a test for @-pattern precedence
Add a test for @-pattern precedence (#3631)