[GHC] #11368: Pattern synonym name is mangled when patterns are non-exhaustive
GHC
ghc-devs at haskell.org
Thu Jan 14 19:49:48 UTC 2016
#11368: Pattern synonym name is mangled when patterns are non-exhaustive
---------------------------------+---------------------------------------
Reporter: Iceland_jack | Owner: mpickering
Type: bug | Status: new
Priority: low | Milestone:
Component: Compiler | Version: 8.1
Resolution: | Keywords: PatternSynonyms
Operating System: Linux | Architecture: x86
Type of failure: Other | Test Case:
Blocked By: | Blocking:
Related Tickets: #11367 | Differential Rev(s):
Wiki Page: |
---------------------------------+---------------------------------------
Comment (by mpickering):
This actually looks a bit more fiddly than I thought. After typechecking
the pat syn is split into the builder and the matcher. Thus in the
desugaring, the buider is just treated like any other function bind (line
128 in DsBinds) which is the cause of the bad error message.
A way to fix this would be to add a new constructor to IdDetails called
PatSynBuilder which carries the PatSyn which was used to build the
relevant Id. FunBind could then be changed to check whether the Id comes
from a pat syn and modify the error message as appropriate.
Does anyone else see an easier way? I guess the error messages should
refer to the right things so I'll have to make these changes.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11368#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list