[project @ 2001-05-03 12:30:35 by simonpj]
authorsimonpj <unknown>
Thu, 3 May 2001 12:30:35 +0000 (12:30 +0000)
committersimonpj <unknown>
Thu, 3 May 2001 12:30:35 +0000 (12:30 +0000)
Add another IP test

ghc/tests/typecheck/should_compile/tc127.hs [new file with mode: 0644]

diff --git a/ghc/tests/typecheck/should_compile/tc127.hs b/ghc/tests/typecheck/should_compile/tc127.hs
new file mode 100644 (file)
index 0000000..815ed5c
--- /dev/null
@@ -0,0 +1,27 @@
+{-# OPTIONS -fglasgow-exts #-}
+
+-- !!! Another implicit parameter test, from Alastair Reid
+
+module ShouldCompile where
+
+import Maybe
+
+type Env = ([(String,Int)],Int)
+
+ident1 :: (?env :: Env) => String -> Int
+ident1 x = y
+ where
+  env = ?env
+  y   = fromJust (lookup x (fst env))
+
+ident2 :: (?env :: Env) => String -> Int
+ident2 x = y
+ where
+  y   = fromJust (lookup x (fst ?env))
+
+
+-- Two more tests from Jeff Lewis
+x () = y where y = ?wibble
+
+f () = ?wibble :: Int
+g () = f ()