Commit 182ff9e8 authored by yoeight's avatar yoeight Committed by eir@cis.upenn.edu
Browse files

Fix tests due to issue #7021


Signed-off-by: eir@cis.upenn.edu's avatarRichard Eisenberg <eir@cis.upenn.edu>
parent e0dadc87
{-# LANGUAGE TemplateHaskell #-}
module T7021 where
import T7021a
func :: a -> Int
func = $(test)
{-# 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 |]
......@@ -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"
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