Test Trac #8450
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 6 Nov 2013 09:46:44 +0000 (09:46 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 6 Nov 2013 09:46:44 +0000 (09:46 +0000)
testsuite/tests/typecheck/should_fail/T8450.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T8450.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T

diff --git a/testsuite/tests/typecheck/should_fail/T8450.hs b/testsuite/tests/typecheck/should_fail/T8450.hs
new file mode 100644 (file)
index 0000000..ac122e7
--- /dev/null
@@ -0,0 +1,8 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+module T8450 where
+
+runEffect :: Either Bool r -> r
+runEffect = undefined
+
+run :: forall a. a
+run = runEffect $ (undefined :: Either a ())
diff --git a/testsuite/tests/typecheck/should_fail/T8450.stderr b/testsuite/tests/typecheck/should_fail/T8450.stderr
new file mode 100644 (file)
index 0000000..3688005
--- /dev/null
@@ -0,0 +1,13 @@
+
+T8450.hs:8:20:
+    Couldn't match type ‛a’ with ‛Bool’
+      ‛a’ is a rigid type variable bound by
+          the type signature for run :: a at T8450.hs:7:15
+    Expected type: Either Bool ()
+      Actual type: Either a ()
+    Relevant bindings include run :: a (bound at T8450.hs:8:1)
+    In the second argument of ‛($)’, namely
+      ‛(undefined :: Either a ())’
+    In the expression: runEffect $ (undefined :: Either a ())
+    In an equation for ‛run’:
+        run = runEffect $ (undefined :: Either a ())
index 0abc6c7..1d15999 100644 (file)
@@ -322,3 +322,4 @@ test('TcCoercibleFail2', when(compiler_lt('ghc', '7.7'), skip), compile_fail, ['
 test('T8306', normal, compile_fail, [''])
 test('T8392a', normal, compile_fail, [''])
 test('T8428', normal, compile_fail, [''])
+test('T8450', normal, compile_fail, [''])