summaryrefslogtreecommitdiff
path: root/testsuite/tests/partial-sigs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-06-18 23:26:48 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2015-06-18 23:26:48 +0100
commitc45f8ceb0de0f83d374909f4cb8dd411154e2bce (patch)
tree1264874fbf53c15dd15f744ed58fb12a5c691ff5 /testsuite/tests/partial-sigs
parentba7c8e5919411f84bdc84caa60317b0cb6c5cdc5 (diff)
downloadhaskell-c45f8ceb0de0f83d374909f4cb8dd411154e2bce.tar.gz
Elaborate test for Trac #10403
Diffstat (limited to 'testsuite/tests/partial-sigs')
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T10403.hs10
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T10403.stderr53
2 files changed, 42 insertions, 21 deletions
diff --git a/testsuite/tests/partial-sigs/should_compile/T10403.hs b/testsuite/tests/partial-sigs/should_compile/T10403.hs
index a33646da5d..6b77e5b488 100644
--- a/testsuite/tests/partial-sigs/should_compile/T10403.hs
+++ b/testsuite/tests/partial-sigs/should_compile/T10403.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE PartialTypeSignatures #-}
+{-# OPTIONS_GHC -fdefer-type-errors #-}
module T10403 where
data I a = I a
@@ -11,9 +12,10 @@ instance Functor (B t) where
newtype H f = H (f ())
-app :: H (B t)
-app = h (H . I) (B ())
-
h :: _ => _
---h :: Functor m => (a -> b) -> m a -> H m
+-- h :: Functor m => (a -> b) -> m a -> H m
h f b = (H . fmap (const ())) (fmap f b)
+
+h2 :: _
+-- h2 :: Functor m => (a -> b) -> m a -> H m
+h2 f b = (H . fmap (const ())) (fmap f b)
diff --git a/testsuite/tests/partial-sigs/should_compile/T10403.stderr b/testsuite/tests/partial-sigs/should_compile/T10403.stderr
index 6b0660dbad..fb78b5609f 100644
--- a/testsuite/tests/partial-sigs/should_compile/T10403.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/T10403.stderr
@@ -1,17 +1,36 @@
-
-T10403.hs:17:6: warning:
- Found hole ‘_’ with inferred constraints: Functor f
- In the type signature for ‘h’: _ => _
-
-T10403.hs:17:11: warning:
- Found hole ‘_’ with type: (a -> b) -> f a -> H f
- Where: ‘f’ is a rigid type variable bound by
- the inferred type of h :: Functor f => (a -> b) -> f a -> H f
- at T10403.hs:19:1
- ‘b’ is a rigid type variable bound by
- the inferred type of h :: Functor f => (a -> b) -> f a -> H f
- at T10403.hs:19:1
- ‘a’ is a rigid type variable bound by
- the inferred type of h :: Functor f => (a -> b) -> f a -> H f
- at T10403.hs:19:1
- In the type signature for ‘h’: _ => _
+
+T10403.hs:15:6: warning:
+ Found hole ‘_’ with inferred constraints: Functor f
+ In the type signature for ‘h’: _ => _
+
+T10403.hs:15:11: warning:
+ Found hole ‘_’ with type: (a -> b) -> f a -> H f
+ Where: ‘f’ is a rigid type variable bound by
+ the inferred type of h :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:17:1
+ ‘b’ is a rigid type variable bound by
+ the inferred type of h :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:17:1
+ ‘a’ is a rigid type variable bound by
+ the inferred type of h :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:17:1
+ In the type signature for ‘h’: _ => _
+
+T10403.hs:19:7: warning:
+ Found hole ‘_’ with type: (a -> b) -> f a -> H f
+ Where: ‘f’ is a rigid type variable bound by
+ the inferred type of h2 :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:21:1
+ ‘b’ is a rigid type variable bound by
+ the inferred type of h2 :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:21:1
+ ‘a’ is a rigid type variable bound by
+ the inferred type of h2 :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:21:1
+ In the type signature for ‘h2’: _
+
+T10403.hs:21:1: warning:
+ No instance for (Functor f)
+ When checking that ‘h2’ has the inferred type
+ h2 :: forall (f :: * -> *) b a. (a -> b) -> f a -> H f
+ Probable cause: the inferred type is ambiguous