Skip to content
  • Vladislav Zavialov's avatar
    46fd8ced
    Fix (~) and (@) infix operators in TH splices (#23748) · 46fd8ced
    Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
    8168b42a "Whitespace-sensitive bang patterns" allows GHC to accept
    the following infix operators:
    
    	a ~ b = ()
    	a @ b = ()
    
    But not if TH is used to generate those declarations:
    
    	$([d| a ~ b = ()
    	      a @ b = ()
    	    |])
    
    	-- Test.hs:5:2: error: [GHC-55017]
    	--    Illegal variable name: ‘~’
    	--    When splicing a TH declaration: (~_0) a_1 b_2 = GHC.Tuple.Prim.()
    
    This is easily fixed by modifying `reservedOps` in GHC.Utils.Lexeme
    46fd8ced
    Fix (~) and (@) infix operators in TH splices (#23748)
    Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
    8168b42a "Whitespace-sensitive bang patterns" allows GHC to accept
    the following infix operators:
    
    	a ~ b = ()
    	a @ b = ()
    
    But not if TH is used to generate those declarations:
    
    	$([d| a ~ b = ()
    	      a @ b = ()
    	    |])
    
    	-- Test.hs:5:2: error: [GHC-55017]
    	--    Illegal variable name: ‘~’
    	--    When splicing a TH declaration: (~_0) a_1 b_2 = GHC.Tuple.Prim.()
    
    This is easily fixed by modifying `reservedOps` in GHC.Utils.Lexeme
Loading