id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
7667	Template Haskell fails to recognize type operator/function +	andygill		"The following message is issued for a valid TH program.

{{{
Main.hs:7:1:
    Illegal type constructor or class name: `+'
    When splicing a TH declaration:
      type instance GHC.TypeLits.+ 1 2 = 3
Failed, modules loaded: Test1.
}}}

Code attached. 

The program is attempting to capture the name +,
as used by Nat at the type level.

The problem appears to be in Convert.hs

{{{
 -- Convert.hs

     okOcc :: OccName.NameSpace -> String -> Bool
     okOcc _ [] = False 
     okOcc ns str@(c:_) | OccName.isVarNameSpace ns = startsVarId c || startsVarSym c
                        | otherwise = startsConId c || startsConSym c || str == ""[]""

}}}

+ is rejected, by okOcc, even though it is acceptable, the symbol neither starts with upper-case, or ':'.


I have tried using reify to extract the *actual* name from other sources (rather than use mkNameG_tc), and it fails in the same way.

"	bug	new	normal	7.8.1	Template Haskell	7.6.2				Unknown/Multiple	Unknown/Multiple	GHC rejects valid program	Unknown				
