[GHC] #11368: Pattern synonym name is mangled when patterns are non-exhaustive

A 3 "*** Exception: /tmp/tmp.t0h0pMgwWb.hs:(4,1)-(5,14): Non-exhaustive
#11368: Pattern synonym name is mangled when patterns are non-exhaustive ---------------------------------------+--------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.1 Keywords: PatternSynonyms | Operating System: Linux Architecture: x86 | Type of failure: Other Test Case: | Blocked By: Blocking: | Related Tickets: #11367 Differential Rev(s): | Wiki Page: ---------------------------------------+--------------------------- {{{ pattern A n <- ... where A 0 = ... }}} When a pattern synonym is non-exhaustive its name is mangled: {{{ patterns in function $bA }}} “Non-exhaustive patterns in pattern synonym A” [https://ghc.haskell.org/trac/ghc/ticket/11367?replyto=5#comment:1 Comment] from ticket #11367. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11368 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11368: Pattern synonym name is mangled when patterns are non-exhaustive ---------------------------------+--------------------------------------- Reporter: Iceland_jack | Owner: 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: | ---------------------------------+--------------------------------------- Description changed by Iceland_jack: Old description:
{{{ pattern A n <- ... where A 0 = ... }}}
When a pattern synonym is non-exhaustive its name is mangled:
A 3 "*** Exception: /tmp/tmp.t0h0pMgwWb.hs:(4,1)-(5,14): Non-exhaustive
{{{ patterns in function $bA }}}
“Non-exhaustive patterns in pattern synonym A”
[https://ghc.haskell.org/trac/ghc/ticket/11367?replyto=5#comment:1 Comment] from ticket #11367.
A 3 "*** Exception: /tmp/tmp.t0h0pMgwWb.hs:(4,1)-(5,14): Non-exhaustive
New description: {{{#!hs pattern A n <- ... where A 0 = ... }}} When a pattern synonym is non-exhaustive its name is mangled: {{{ patterns in function $bA }}} “Non-exhaustive patterns in pattern synonym A” [https://ghc.haskell.org/trac/ghc/ticket/11367?replyto=5#comment:1 Comment] from ticket #11367. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11368#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: | ---------------------------------+--------------------------------------- Changes (by mpickering): * owner: => mpickering -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11368#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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

#11368: Pattern synonym name is mangled when patterns are non-exhaustive ---------------------------------+--------------------------------------- Reporter: Iceland_jack | Owner: (none) 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: | ---------------------------------+--------------------------------------- Changes (by mpickering): * owner: mpickering => (none) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11368#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC