Opened 4 years ago

Closed 4 years ago

#12109 closed bug (duplicate)

Matching on pattern synonym succeeds compiled with ghc, fails with ghci

Reported by: Iceland_jack Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.0.1
Keywords: PatternSynonyms Cc: mpickering
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #12007 Differential Rev(s):
Wiki Page:


A file /tmp/test.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 

fails with ghci

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

Please report this as a GHC bug:


Change History (2)

comment:1 Changed 4 years ago by Iceland_jack

$ ghci -ignore-dot-ghci
GHCi, version  :? for help
Prelude> :set -XPatternSynonyms 
Prelude> :set -XViewPatterns 
Prelude> pattern Parsed x = [(x, "")]
Prelude> pattern Read a <- (reads -> Parsed a)
Prelude> let Read x = "420" in (x::Int)


comment:2 Changed 4 years ago by mpickering

Resolution: duplicate
Status: newclosed

This is the same as #12007

Note: See TracTickets for help on using tickets.