Panic on TypeFamilies compile
The following code produces a panic:
> {-# LANGUAGE TypeFamilies #-}
> module Bug where
> tracer :: (Functor f, Coinductive f) => (c -> f c) -> (c -> f c)
> tracer = h where h = (\(_, b) -> ((outI . fmap h) b)) . out
> class Functor g => Coinductive g where
> type Nu g :: *
> out :: Nu g -> g (Nu g)
> outI :: g (Nu g) -> Nu g
Compiling with ghc-7.6.3 gives:
$ ghc Bug.lhs
[1 of 1] Compiling Bug ( Bug.lhs, Bug.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.6.3 for x86_64-apple-darwin):
cgLookupPanic (probably invalid Core; try -dcore-lint)
h{v aeN} [lid]
static binds for:
local binds for:
main:Bug.outI{v r0} [gid[ClassOp]]
main:Bug.out{v r1} [gid[ClassOp]]
main:Bug.$p1Coinductive{v reT} [gid[ClassOp]]
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |