
#9160: Panic: Template variable unbound in rewrite rule -------------------------------------+------------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.3 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | indexed_types/should_fail/T9160 Related Tickets: #4524 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by slyfox): Replying to [comment:13 George]:
I am also seeing this on ghc 7.10.1, not sure if this is another instance of this bug:
cabal install bitmap [ 3 of 10] Compiling Data.Bitmap.IO ( Data/Bitmap/IO.hs, dist/build/Data/Bitmap/IO.o )
I've distilled it a bit to a selfcontained test: {{{#!hs -- sf 9160 # cat B.hs {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -O2 #-} module B (bug) where data D = D data E = E class Storable a where poke2 :: a -> E instance Storable D where poke2 = poke2 -- undefined class Foo a where instance Foo D where class (Foo t, Storable t) => FooStorable t where instance FooStorable D where {-# SPECIALIZE instance FooStorable D #-} {-# SPECIALIZE bug :: D -> E #-} bug :: FooStorable t => t -> E bug = poke2 {- sf 9160 # ghc -c -fforce-recomp -Wall B.hs B.hs:5:10: Warning: Defined but not used: data constructor āDā B.hs:6:10: Warning: Defined but not used: data constructor āEā ghc: panic! (the 'impossible' happened) (GHC version 7.10.1 for x86_64-unknown-linux): Template variable unbound in rewrite rule $fFooStorableD_XU [$fFooStorableD_XU] [$fFooStorableD_XU] [] [] Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug -} }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler