Commit d947d38f authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #5434 and #5452

parent 8af2f36d
{-# LANGUAGE TemplateHaskell #-}
module T5434 where
import T5434a
$(genShadow1)
v :: Bool
v = True
$(genShadow2)
T5434.hs:12:3:
Warning: This binding for `x' shadows the existing binding
bound at T5434.hs:7:3
{-# LANGUAGE TemplateHaskell #-}
module T5434a where
import Language.Haskell.TH
genShadow1 :: Q [Dec]
genShadow1 =
[d| x :: Char
x = 'x'
|]
genShadow2 :: Q [Dec]
genShadow2 =
[d| z :: Char
z = succ x
where x = 'y'
|]
{-# LANGUAGE TemplateHaskell, KindSignatures, FlexibleInstances #-}
module T5452 where
import Language.Haskell.TH
class C (f :: * -> *)
class D (f :: * -> *)
instance C ((,) Int)
$(do { ClassI _ [inst_dec] <- reify ''C
; let InstanceD cxt (AppT _ ty) _ = inst_dec
; return [InstanceD cxt
(foldl AppT (ConT ''D) [ty])
[]
] })
......@@ -204,3 +204,6 @@ test('TH_lookupName',
extra_clean(['TH_lookupName_Lib.hi', 'TH_lookupName_Lib.o']),
multimod_compile_and_run,
['TH_lookupName.hs', ''])
test('T5452', normal, compile, ['-v0'])
test('T5434', extra_clean(['T5434a.hi','T5434a.o']),
multimod_compile, ['T5434','-v0 -Wall'])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment