id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
4233	GHC internal error: `w' is not in scope during type checking, but it passed the renamer	lilac		"{{{
{-# 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|]
}}}"	bug	closed	normal		Template Haskell	6.12.1	fixed			Unknown/Multiple	Unknown/Multiple	Compile-time crash		Th/T4233			
