Make tcrun042 fail
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 30 Sep 2016 13:33:19 +0000 (14:33 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 30 Sep 2016 13:33:19 +0000 (14:33 +0100)
This test uses wholesale impredicative polymorphism, and now fails.
That's ok.

testsuite/tests/typecheck/should_run/all.T
testsuite/tests/typecheck/should_run/tcrun042.hs
testsuite/tests/typecheck/should_run/tcrun042.stderr [new file with mode: 0644]

index c2b277d..fa6273a 100755 (executable)
@@ -62,7 +62,7 @@ test('tcrun038',
 test('tcrun039', normal, compile_and_run, [''])
 test('tcrun040', normal, compile_and_run, [''])
 test('tcrun041', omit_ways(['ghci']), compile_and_run, [''])
-test('tcrun042', normal, compile_and_run, [''])
+test('tcrun042', normal, compile_fail, [''])
 test('tcrun043', normal, compile_and_run, [''])
 test('tcrun044', normal, compile_and_run, [''])
 test('tcrun045', normal, compile_fail, [''])
index 1ea5c24..ba4251c 100644 (file)
@@ -1,4 +1,12 @@
 {-# LANGUAGE TupleSections, RankNTypes, ImpredicativeTypes #-}
+
+-- Sept 16: This test involves wholesale use of impredicative polymorhism
+--          and I'm amazed it has worked for so long. Anyway it is now
+--          failing, which is OK.  We don't really suport impredicative
+--          polymorphism!
+--
+-- The test was added by Max in 5e8ff849, appretly to test tuple sections
+
 module Main where
 
 e :: a -> (forall b. b -> b -> b) -> (a, String, forall c. c -> c -> c)
diff --git a/testsuite/tests/typecheck/should_run/tcrun042.stderr b/testsuite/tests/typecheck/should_run/tcrun042.stderr
new file mode 100644 (file)
index 0000000..52d9b29
--- /dev/null
@@ -0,0 +1,6 @@
+
+tcrun042.hs:13:5: error:
+    • Couldn't match expected type ‘forall c. c -> c -> c’
+                  with actual type ‘b0 -> b0 -> b0’
+    • In the expression: (, "Hello" ++ "World",)
+      In an equation for ‘e’: e = (, "Hello" ++ "World",)