[GHC] #12109: Matching on pattern synonym succeeds compiled with ghc, fails with ghci

GHC ghc-devs at haskell.org
Tue May 24 01:32:21 UTC 2016


#12109: Matching on pattern synonym succeeds compiled with ghc, fails with ghci
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
  PatternSynonyms                    |
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 A file `/tmp/test.hs`

 {{{#!hs
 {-# Language PatternSynonyms, ViewPatterns #-}

 pattern Parsed x = [(x, "")]
 pattern Read a <- (reads -> Parsed a)

 main = do
   let Read x = "420"
   print (x::Int)
 }}}

 {{{
 $ ghc -ignore-dot-ghci /tmp/test.hs && /tmp/test
 420
 }}}

 fails with ghci

 {{{#!hs
 $ ghci -ignore-dot-ghci /tmp/test.hs
 GHCi, version 8.0.0.20160511: http://www.haskell.org/ghc/  :? for help
 [1 of 1] Compiling Main             ( /tmp/test.hs, interpreted )
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.0.0.20160511 for x86_64-unknown-linux):
         kindPrimRep.go rep_a1XC

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

 >
 }}}

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


More information about the ghc-tickets mailing list