[commit: ghc] master: Add regression tests for #12947, #13640 (38a3819)

git at git.haskell.org git at git.haskell.org
Sat May 6 16:39:03 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/38a381912f67c0f6f3fba8de1026d7464826b851/ghc

>---------------------------------------------------------------

commit 38a381912f67c0f6f3fba8de1026d7464826b851
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Sat May 6 12:31:40 2017 -0400

    Add regression tests for #12947, #13640
    
    Summary:
    Commit b4bdbe4957ae8b82c4cda5584203b44d3c4f004f (the fix for #12156)
    wound up being the fix for #12947 and #13640 as well. This adds regression
    tests for the latter two tickets to keep them fixed.
    
    Test Plan: make test TEST="T12947 T13640"
    
    Reviewers: bgamari, austin
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #12947, #13640
    
    Differential Revision: https://phabricator.haskell.org/D3528


>---------------------------------------------------------------

38a381912f67c0f6f3fba8de1026d7464826b851
 testsuite/tests/typecheck/should_fail/T12947.hs     | 15 +++++++++++++++
 testsuite/tests/typecheck/should_fail/T12947.stderr |  3 +++
 testsuite/tests/typecheck/should_fail/T13640.hs     | 13 +++++++++++++
 testsuite/tests/typecheck/should_fail/T13640.stderr |  8 ++++++++
 testsuite/tests/typecheck/should_fail/all.T         |  2 ++
 5 files changed, 41 insertions(+)

diff --git a/testsuite/tests/typecheck/should_fail/T12947.hs b/testsuite/tests/typecheck/should_fail/T12947.hs
new file mode 100644
index 0000000..d8a837c
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T12947.hs
@@ -0,0 +1,15 @@
+{-# OPTIONS_GHC -dcore-lint -fdefer-typed-holes #-}
+module T12947 where
+
+import qualified Control.Monad.Fail as Fail
+
+newtype P m a = P { unP :: (a -> IO (m ())) -> IO (m ()) }
+
+instance Functor (P m) where
+
+instance Applicative (P m) where
+
+instance Monad (P m) where
+
+instance (Fail.MonadFail m) => Fail.MonadFail (P m) where
+  fail msg = ContT $ \ _ -> Fail.fail msg
diff --git a/testsuite/tests/typecheck/should_fail/T12947.stderr b/testsuite/tests/typecheck/should_fail/T12947.stderr
new file mode 100644
index 0000000..a5d9193
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T12947.stderr
@@ -0,0 +1,3 @@
+
+T12947.hs:15:14: error:
+    Data constructor not in scope: ContT :: (p0 -> m0 a0) -> P m a
diff --git a/testsuite/tests/typecheck/should_fail/T13640.hs b/testsuite/tests/typecheck/should_fail/T13640.hs
new file mode 100644
index 0000000..be0faf7
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T13640.hs
@@ -0,0 +1,13 @@
+{-# OPTIONS_GHC -dcore-lint -fdefer-typed-holes #-}
+module T13640 where
+
+import Prelude hiding ((.))
+
+class Functor' f where
+  map' :: (a -> b) -> f a -> f b
+
+class Bifunctor' f where
+  map2' :: (a -> b) -> f a c -> f b c
+
+bimap' :: Bifunctor' f => (a -> b) -> (c -> d) -> (f a c -> f b d)
+bimap' f g = map2' f . map'
diff --git a/testsuite/tests/typecheck/should_fail/T13640.stderr b/testsuite/tests/typecheck/should_fail/T13640.stderr
new file mode 100644
index 0000000..d926dd9
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T13640.stderr
@@ -0,0 +1,8 @@
+
+T13640.hs:13:22: error:
+    • Variable not in scope:
+        (.)
+          :: (f0 a c0 -> f0 b c0)
+             -> ((a0 -> b0) -> f1 a0 -> f1 b0) -> f a c -> f b d
+    • Perhaps you want to remove ‘.’ from the explicit hiding list
+      in the import of ‘Prelude’ (T13640.hs:4:1-27).
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 3aa8cd5..4a409e0 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -422,6 +422,7 @@ test('T12837', normal, compile_fail, [''])
 test('T12918a', normal, compile_fail, [''])
 test('T12918b', normal, compile_fail, [''])
 test('T12921', normal, compile_fail, [''])
+test('T12947', normal, compile_fail, [''])
 test('T12973', normal, compile_fail, [''])
 test('StrictBinds', normal, compile_fail, [''])
 test('T13068', [extra_files(['T13068.hs', 'T13068a.hs', 'T13068.hs-boot', 'T13068m.hs'])], multimod_compile_fail, ['T13068m', ''])
@@ -436,3 +437,4 @@ test('T13446', normal, compile_fail, [''])
 test('T13506', normal, compile_fail, [''])
 test('T13611', expect_broken(13611), compile_fail, [''])
 test('T13320', normal, compile_fail, [''])
+test('T13640', normal, compile_fail, [''])



More information about the ghc-commits mailing list