[GHC] #14241: Pattern synonyms defined through other pattern synonyms produce `impossible happened`

GHC ghc-devs at haskell.org
Sat Sep 16 08:53:45 UTC 2017


#14241: Pattern synonyms defined through other pattern synonyms produce `impossible
happened`
---------------------------------------+-------------------------------
           Reporter:  Heimdell         |             Owner:  (none)
               Type:  bug              |            Status:  new
           Priority:  normal           |         Milestone:
          Component:  Compiler         |           Version:  8.0.1
           Keywords:  PatternSynonyms  |  Operating System:  Linux
       Architecture:  x86_64 (amd64)   |   Type of failure:  GHCi crash
          Test Case:                   |        Blocked By:
           Blocking:                   |   Related Tickets:
Differential Rev(s):                   |         Wiki Page:
---------------------------------------+-------------------------------
 This module content (Bug.hs)
 {{{#!hs
 {-# language PatternSynonyms #-}

 data A a = A a

 pattern B a = A a
 pattern C a = B a
 }}}
 causes ghci/runhaskell to fail:
 {{{
 > :l Bug
 [1 of 1] Compiling Main             ( Bug.hs, interpreted )
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.0.1 for x86_64-unknown-linux):
         kindPrimRep.go rep_a1r0

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}

 When using ghc everything compiles and even works, so adding the code
 {{{#!hs
 main = do
   let C a = A 1
   print a
 }}}
 produced executable that prints "1".

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14241>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list