summaryrefslogtreecommitdiff
path: root/testsuite/tests/partial-sigs/should_compile
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/partial-sigs/should_compile')
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T14658.hs10
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T14658.stderr9
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T14715.stderr2
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T18646.hs16
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T18646.stderr22
-rw-r--r--testsuite/tests/partial-sigs/should_compile/all.T2
6 files changed, 60 insertions, 1 deletions
diff --git a/testsuite/tests/partial-sigs/should_compile/T14658.hs b/testsuite/tests/partial-sigs/should_compile/T14658.hs
new file mode 100644
index 0000000000..7c985cb180
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T14658.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE PartialTypeSignatures, ImplicitParams #-}
+
+module T14658 where
+
+import GHC.Stack
+
+-- Test ensures that the final 'f' has a CallStack constraint
+-- as specified in the partial type signature
+foo :: (?loc :: CallStack, _) => a -> a -> Bool
+foo x y = x==y
diff --git a/testsuite/tests/partial-sigs/should_compile/T14658.stderr b/testsuite/tests/partial-sigs/should_compile/T14658.stderr
new file mode 100644
index 0000000000..7c76ea24e2
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T14658.stderr
@@ -0,0 +1,9 @@
+
+T14658.hs:9:28: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found extra-constraints wildcard standing for ‘Eq a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of
+ foo :: (?loc::CallStack, Eq a) => a -> a -> Bool
+ at T14658.hs:9:1-47
+ • In the type signature:
+ foo :: (?loc :: CallStack, _) => a -> a -> Bool
diff --git a/testsuite/tests/partial-sigs/should_compile/T14715.stderr b/testsuite/tests/partial-sigs/should_compile/T14715.stderr
index 4d3a668241..286ca25671 100644
--- a/testsuite/tests/partial-sigs/should_compile/T14715.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/T14715.stderr
@@ -3,7 +3,7 @@ T14715.hs:13:53: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Found extra-constraints wildcard standing for ‘Reduce z zq’
Where: ‘z’, ‘zq’ are rigid type variables bound by
the inferred type of
- bench_mulPublic :: (z ~ LiftOf zq, Reduce z zq) =>
+ bench_mulPublic :: (LiftOf zq ~ z, Reduce z zq) =>
Cyc zp -> Cyc z -> IO (zp, zq)
at T14715.hs:13:27-33
• In the type signature:
diff --git a/testsuite/tests/partial-sigs/should_compile/T18646.hs b/testsuite/tests/partial-sigs/should_compile/T18646.hs
new file mode 100644
index 0000000000..6cad019853
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T18646.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE PartialTypeSignatures #-}
+
+module Foo where
+
+class Foo x where
+ foo :: x
+
+bar :: (Foo (), _) => f ()
+bar = pure foo
+
+marie :: (Foo x, _) => f x
+marie = pure foo
+
+anne :: _ => f x
+anne = pure foo
diff --git a/testsuite/tests/partial-sigs/should_compile/T18646.stderr b/testsuite/tests/partial-sigs/should_compile/T18646.stderr
new file mode 100644
index 0000000000..ab5bd90aa5
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T18646.stderr
@@ -0,0 +1,22 @@
+
+T18646.hs:9:17: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found extra-constraints wildcard standing for ‘Applicative f’
+ Where: ‘f’ is a rigid type variable bound by
+ the inferred type of bar :: (Foo (), Applicative f) => f ()
+ at T18646.hs:9:1-26
+ • In the type signature: bar :: (Foo (), _) => f ()
+
+T18646.hs:12:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found extra-constraints wildcard standing for ‘Applicative f’
+ Where: ‘f’ is a rigid type variable bound by
+ the inferred type of marie :: (Foo x, Applicative f) => f x
+ at T18646.hs:12:1-26
+ • In the type signature: marie :: (Foo x, _) => f x
+
+T18646.hs:15:9: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found extra-constraints wildcard standing for
+ ‘(Applicative f, Foo x)’
+ Where: ‘f’, ‘x’ are rigid type variables bound by
+ the inferred type of anne :: (Applicative f, Foo x) => f x
+ at T18646.hs:15:1-16
+ • In the type signature: anne :: _ => f x
diff --git a/testsuite/tests/partial-sigs/should_compile/all.T b/testsuite/tests/partial-sigs/should_compile/all.T
index 8bb939addd..00d051447f 100644
--- a/testsuite/tests/partial-sigs/should_compile/all.T
+++ b/testsuite/tests/partial-sigs/should_compile/all.T
@@ -97,3 +97,5 @@ test('T16728a', normal, compile, [''])
test('T16728b', normal, compile, [''])
test('T18008', normal, compile, [''])
test('T16762d', normal, compile, [''])
+test('T14658', normal, compile, [''])
+test('T18646', normal, compile, [''])