summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-05-13 17:17:22 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2015-05-13 17:17:22 +0100
commita9ccd37add8315e061c02e5bf26c08f05fad9ac9 (patch)
treef6742db997e02c839baa4d981121ea364a1683ca /testsuite
parentc0aae6f699cbd222d826d0b8d78d6cb3f682079e (diff)
downloadhaskell-a9ccd37add8315e061c02e5bf26c08f05fad9ac9.tar.gz
Test Trac #10403
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T10403.hs19
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T10403.stderr17
-rw-r--r--testsuite/tests/partial-sigs/should_compile/all.T1
3 files changed, 37 insertions, 0 deletions
diff --git a/testsuite/tests/partial-sigs/should_compile/T10403.hs b/testsuite/tests/partial-sigs/should_compile/T10403.hs
new file mode 100644
index 0000000000..a33646da5d
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T10403.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE PartialTypeSignatures #-}
+module T10403 where
+
+data I a = I a
+instance Functor I where
+ fmap f (I a) = I (f a)
+
+newtype B t a = B a
+instance Functor (B t) where
+ fmap f (B a) = B (f a)
+
+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 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
new file mode 100644
index 0000000000..6b0660dbad
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T10403.stderr
@@ -0,0 +1,17 @@
+
+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’: _ => _
diff --git a/testsuite/tests/partial-sigs/should_compile/all.T b/testsuite/tests/partial-sigs/should_compile/all.T
index e83e070dcd..91294a580c 100644
--- a/testsuite/tests/partial-sigs/should_compile/all.T
+++ b/testsuite/tests/partial-sigs/should_compile/all.T
@@ -46,3 +46,4 @@ test('SomethingShowable', normal, compile, ['-ddump-types -fno-warn-partial-type
test('Uncurry', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
test('UncurryNamed', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
test('WarningWildcardInstantiations', normal, compile, ['-ddump-types'])
+test('T10403', normal, compile, [''])