From 1b56645432591432812fc53031ef9d8e402753d1 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 3 May 2001 12:30:35 +0000 Subject: [PATCH] [project @ 2001-05-03 12:30:35 by simonpj] Add another IP test --- ghc/tests/typecheck/should_compile/tc127.hs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ghc/tests/typecheck/should_compile/tc127.hs diff --git a/ghc/tests/typecheck/should_compile/tc127.hs b/ghc/tests/typecheck/should_compile/tc127.hs new file mode 100644 index 0000000..815ed5c --- /dev/null +++ b/ghc/tests/typecheck/should_compile/tc127.hs @@ -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 () -- 1.7.10.4