#4233: GHC internal error: `w' is not in scope during type checking, but it 
passed
the renamer
---------------------------------+------------------------------------------
    Reporter:  lilac             |       Owner:                    
        Type:  bug               |      Status:  new               
    Priority:  normal            |   Component:  Template Haskell  
     Version:  6.12.1            |    Keywords:                    
    Testcase:                    |   Blockedby:                    
          Os:  Unknown/Multiple  |    Blocking:                    
Architecture:  Unknown/Multiple  |     Failure:  Compile-time crash
---------------------------------+------------------------------------------
 {{{
 {-# LANGUAGE TypeFamilies, TypeOperators, TemplateHaskell #-}
 import Language.Haskell.TH
 type family a :<=: b
 w = varT (mkName "w")
 f = [t|Maybe $w :<=: Int|]
 }}}

 fails with

 {{{
     GHC internal error: `w' is not in scope during type checking, but it
 passed the renamer
     tcg_type_env of environment: [(rgd, Type constructor `:<=:')]
     In the expression: w
     In the Template Haskell quotation [t| Maybe $w :<=: Int |]
     In the expression: [t| Maybe $w :<=: Int |]
 }}}

 This testcase was produced by attempting to cut down a case which
 produces:

 {{{
 ghc: panic! (the 'impossible' happened)
   (GHC version 6.12.1 for x86_64-unknown-linux):
         nameModule way{v a37C}
 }}}

 I don't know whether the underlying cause is the same. In both cases the
 bug can be avoided by a refactoring:

 {{{
 a x = [t|Maybe $x|]
 f = conT ''(:<=:) `appT` a x `appT` [t|Int|]
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4233>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to