diff options
author | YoEight <yo.eight@gmail.com> | 2014-01-11 13:47:24 +0100 |
---|---|---|
committer | Richard Eisenberg <eir@cis.upenn.edu> | 2014-02-09 12:57:30 -0500 |
commit | 182ff9e814a917681b1600b2729c3340801630de (patch) | |
tree | a3c5704b918a7334a62c2270c646ae4be1225a41 /testsuite | |
parent | e0dadc87b57ce7f4ec3b72eb52e4abe5a5218f52 (diff) | |
download | haskell-182ff9e814a917681b1600b2729c3340801630de.tar.gz |
Fix tests due to issue #7021
Signed-off-by: Richard Eisenberg <eir@cis.upenn.edu>
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/th/T7021.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/th/T7021a.hs | 31 | ||||
-rw-r--r-- | testsuite/tests/th/TH_genExLib.hs | 4 |
3 files changed, 40 insertions, 2 deletions
diff --git a/testsuite/tests/th/T7021.hs b/testsuite/tests/th/T7021.hs new file mode 100644 index 0000000000..31e18431ad --- /dev/null +++ b/testsuite/tests/th/T7021.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TemplateHaskell #-} +module T7021 where + +import T7021a + +func :: a -> Int +func = $(test) diff --git a/testsuite/tests/th/T7021a.hs b/testsuite/tests/th/T7021a.hs new file mode 100644 index 0000000000..bd191336dd --- /dev/null +++ b/testsuite/tests/th/T7021a.hs @@ -0,0 +1,31 @@ +{-# LANGUAGE ConstraintKinds, TemplateHaskell, PolyKinds, TypeFamilies #-} + +module T7021a where + +import GHC.Prim +import Language.Haskell.TH + +type IOable a = (Show a, Read a) +type family ALittleSilly :: Constraint + +data Proxy a = Proxy + +foo :: IOable a => a +foo = undefined + +baz :: a b => Proxy a -> b +baz = undefined + +bar :: ALittleSilly => a +bar = undefined + +test :: Q Exp +test = do + Just fooName <- lookupValueName "foo" + Just bazName <- lookupValueName "baz" + Just barName <- lookupValueName "bar" + reify fooName + reify bazName + reify barName + [t| (Show a, (Read a, Num a)) => a -> a |] + [| \_ -> 0 |] diff --git a/testsuite/tests/th/TH_genExLib.hs b/testsuite/tests/th/TH_genExLib.hs index 02784ac87b..d439231815 100644 --- a/testsuite/tests/th/TH_genExLib.hs +++ b/testsuite/tests/th/TH_genExLib.hs @@ -11,10 +11,10 @@ genAny decl = do { d <- decl } genAnyClass :: Name -> [Dec] -> Dec -genAnyClass name decls +genAnyClass name decls = DataD [] anyName [] [constructor] [] where anyName = mkName ("Any" ++ nameBase name ++ "1111") - constructor = ForallC [PlainTV var_a] [ClassP name [VarT var_a]] $ + constructor = ForallC [PlainTV var_a] [AppT (ConT name) (VarT var_a)] $ NormalC anyName [(NotStrict, VarT var_a)] var_a = mkName "a" |