summaryrefslogtreecommitdiff
path: root/testsuite/tests/deSugar/should_run/DsStaticPointers.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/deSugar/should_run/DsStaticPointers.hs')
-rw-r--r--testsuite/tests/deSugar/should_run/DsStaticPointers.hs30
1 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/tests/deSugar/should_run/DsStaticPointers.hs b/testsuite/tests/deSugar/should_run/DsStaticPointers.hs
new file mode 100644
index 0000000000..7f61bc56f5
--- /dev/null
+++ b/testsuite/tests/deSugar/should_run/DsStaticPointers.hs
@@ -0,0 +1,30 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE StaticPointers #-}
+
+import Data.Typeable
+import GHC.StaticPtr
+
+main = putStr $ unlines $ map show names
+ where
+ names =
+ [ staticPtrInfo $ static g
+ , staticPtrInfo $ (static id :: StaticPtr (Int -> Int))
+ , staticPtrInfo $ (p0 :: StaticPtr (Int -> Int))
+ , staticPtrInfo $ (static method :: StaticPtr (Char -> Int))
+ , staticPtrInfo $ (static t_field :: StaticPtr (T Int -> Int))
+ ]
+
+g :: Int -> Int
+g = id
+
+p0 :: Typeable a => StaticPtr (a -> a)
+p0 = static (\x -> x)
+
+data T a = T { t_field :: a }
+ deriving Typeable
+
+class C1 a where
+ method :: a -> Int
+
+instance C1 Char where
+ method = const 0