
#13415: Instance declarations don't recognize named wildcards -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.4.1 Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: #13324 | Differential Rev(s): Phab:D3332 Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Replying to [comment:4 simonpj]:
What would you like it to say? You get the exact same message from {{{ instance x => Show (Maybe a) }}}
That isn't using a named wildcard, so I would expect that to give an error message involving `ConstraintKinds`. I wouldn't expect it from a named wildcard `_x`, however.
In any case, making instance declarations have `LHsSIgWcType` sounds as if instnace are ''allowed''' to have wildcards, but they aren't, so that feels like the wrong solution.
It's true that instance heads aren't allowed to have wildcards. But then again, there are many other types in which wildcards are allowed to appear syntactically (e.g., `data Foo _`) but are later rejected, so we're not breaking convention by doing this. Besides, I don't see any simpler solution. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13415#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler