summaryrefslogtreecommitdiff
path: root/testsuite/tests/partial-sigs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-06-23 13:14:26 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2015-06-23 13:14:26 +0100
commit55843f1c43ec3721a924cbbe5d422798819030c1 (patch)
tree7e037742cf2bd44dc0990ff21559f70a1c962d82 /testsuite/tests/partial-sigs
parent01f7e440ce221c01ba082003c372b5420e42797b (diff)
downloadhaskell-55843f1c43ec3721a924cbbe5d422798819030c1.tar.gz
Further elaborate Trac #10403 test
Adding app1, app2, as requested in the ticket
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.stderr72
2 files changed, 44 insertions, 38 deletions
diff --git a/testsuite/tests/partial-sigs/should_compile/T10403.hs b/testsuite/tests/partial-sigs/should_compile/T10403.hs
index 6b77e5b488..97cda7ae2b 100644
--- a/testsuite/tests/partial-sigs/should_compile/T10403.hs
+++ b/testsuite/tests/partial-sigs/should_compile/T10403.hs
@@ -12,10 +12,16 @@ instance Functor (B t) where
newtype H f = H (f ())
-h :: _ => _
+h1 :: _ => _
-- h :: Functor m => (a -> b) -> m a -> H m
-h f b = (H . fmap (const ())) (fmap f b)
+h1 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)
+
+app1 :: H (B t)
+app1 = h1 (H . I) (B ())
+
+app2 :: H (B t)
+app2 = h2 (H . I) (B ())
diff --git a/testsuite/tests/partial-sigs/should_compile/T10403.stderr b/testsuite/tests/partial-sigs/should_compile/T10403.stderr
index fb78b5609f..9aec3e28d7 100644
--- a/testsuite/tests/partial-sigs/should_compile/T10403.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/T10403.stderr
@@ -1,36 +1,36 @@
-
-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
+
+T10403.hs:15:7: warning:
+ Found hole ‘_’ with inferred constraints: Functor f
+ In the type signature for ‘h1’: _ => _
+
+T10403.hs:15:12: warning:
+ Found hole ‘_’ with type: (a -> b) -> f a -> H f
+ Where: ‘f’ is a rigid type variable bound by
+ the inferred type of h1 :: 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 h1 :: 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 h1 :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:17:1
+ In the type signature for ‘h1’: _ => _
+
+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