Ticket #7438: GHC-7438.hs

File GHC-7438.hs, 0.7 KB (added by heisenbug, 6 months ago)

reproduction testcase

Line 
1{-# LANGUAGE GADTs, KindSignatures, DataKinds, FlexibleInstances #-}
2
3import Data.Thrist -- cabal install thrist-0.3
4
5data Nat = Zt | St Nat
6
7data At :: * -> Nat -> Nat -> * where
8  HoldChar :: Char -> At Char n (St n)
9
10instance Show (Thrist (At Char) m n) where
11  show t = '"' : go t ('"':[])
12    where -- go :: Thrist (At Char) m' n' -> String -> String
13          go Nil acc = acc
14          go (Cons (HoldChar c) rest) acc = c : go rest acc
15
16{-
17
18Results in:
19
20ghc: panic! (the 'impossible' happened)
21  (GHC version 7.7.20121114 for x86_64-unknown-linux):
22        tcTyVarDetails
23<<details unavailable>>
24
25Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
26
27
28When the type declaration of 'go' is present,
29this compiles.
30
31-}