[project @ 2000-10-05 16:03:22 by simonpj]
authorsimonpj <unknown>
Thu, 5 Oct 2000 16:03:22 +0000 (16:03 +0000)
committersimonpj <unknown>
Thu, 5 Oct 2000 16:03:22 +0000 (16:03 +0000)
Add test for for-all types in arguments

ghc/tests/typecheck/should_fail/tcfail088.hs [new file with mode: 0644]
ghc/tests/typecheck/should_fail/tcfail088.stderr [new file with mode: 0644]

diff --git a/ghc/tests/typecheck/should_fail/tcfail088.hs b/ghc/tests/typecheck/should_fail/tcfail088.hs
new file mode 100644 (file)
index 0000000..00991a3
--- /dev/null
@@ -0,0 +1,15 @@
+{-# OPTIONS -fglasgow-exts #-}
+
+-- !!! Check that forall types can't be arguments
+module ShouldFail where
+
+
+data T s a = MkT s a
+instance Ord a => Ord (forall s. T s a) 
+-- A for-all should not appear as an argument to Ord
+
+
+
+g :: T s (forall b.b)
+g = error "urk"
diff --git a/ghc/tests/typecheck/should_fail/tcfail088.stderr b/ghc/tests/typecheck/should_fail/tcfail088.stderr
new file mode 100644 (file)
index 0000000..bd08451
--- /dev/null
@@ -0,0 +1,12 @@
+
+tcfail088.hs:9:
+    Illegal polymorphic type as argument: forall s. T s a
+    When checking kinds in `Ord (forall s. T s a)'
+
+tcfail088.hs:14:
+    Illegal polymorphic type as argument: forall b. b
+    When checking kinds in `T s (forall b. b)'
+    In a type signature for `g'
+
+Compilation had errors
+