[GHC] #12072: GHC panic on type wildcard in left-hand side of data family
#12072: GHC panic on type wildcard in left-hand side of data family -------------------------------------+------------------------------------- Reporter: andreash | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Keywords: | Operating System: Linux Architecture: x86_64 | Type of failure: Compile-time (amd64) | crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- While playing around with data families I received the following output by ghc/ghci: {{{ ghc: panic! (the 'impossible' happened) (GHC version 7.10.3 for x86_64-unknown-linux): rnHsTyKi HsWildcardTy Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} I had accidentally left a wildcard `_` on the left-hand side of a data instance definition. To reproduce enter the following code into a file and try to load that file into ghci, or try to compile it with ghc: {{{#!hs data family Bug x data instance Bug _ = Bug }}} The expected behavior would be a (non-panic) error message of some sort. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12072> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12072: GHC panic on type wildcard in left-hand side of data family -------------------------------------+------------------------------------- Reporter: andreash | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * resolution: => fixed Comment: Thanks. This is OK in HEAD (and I hope 8.0). Wildcards are explicitly allowed on the LHS of type/data family instances. See the [http://downloads.haskell.org/~ghc/master/users-guide/glasgow_exts.html #data-instance-declarations user manual Section 9.9.1.2]. You are right that it's a bug in 7.10.3. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12072#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12072: GHC panic on type wildcard in left-hand side of data family -------------------------------------+------------------------------------- Reporter: andreash | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"f9e90bcb202b164189d71535eafbb39577682ff2/ghc" f9e90bcb/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="f9e90bcb202b164189d71535eafbb39577682ff2" Improve documentation for type wildcards This docmentation improvement was triggered by Trac #12072 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12072#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12072: GHC panic on type wildcard in left-hand side of data family -------------------------------------+------------------------------------- Reporter: andreash | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"6b583745e63b1489312bb37218028fa8ab2fbbf8/ghc" 6b583745/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="6b583745e63b1489312bb37218028fa8ab2fbbf8" Improve documentation for type wildcards This docmentation improvement was triggered by Trac #12072 (cherry picked from commit f9e90bcb202b164189d71535eafbb39577682ff2) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12072#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC