summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2013-04-23 09:19:47 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2013-04-23 09:19:47 +0100
commitaf58cc6f75d2e7eaae74e74a48b9eaa3cd8113ab (patch)
tree0cc274ba8e42ee61f3b63ca1d9c7ec598b2749be /testsuite
parent0d0739096c969f9380336bb8f1f11c302fcf539f (diff)
downloadhaskell-af58cc6f75d2e7eaae74e74a48b9eaa3cd8113ab.tar.gz
Test Trac #7857
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/typecheck/should_fail/T7857.hs8
-rw-r--r--testsuite/tests/typecheck/should_fail/T7857.stderr16
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
3 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T7857.hs b/testsuite/tests/typecheck/should_fail/T7857.hs
new file mode 100644
index 0000000000..d50efd5696
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T7857.hs
@@ -0,0 +1,8 @@
+module T7857 where
+
+import Text.Printf
+
+f :: a -> b
+f = undefined
+
+g i = f $ printf "" i
diff --git a/testsuite/tests/typecheck/should_fail/T7857.stderr b/testsuite/tests/typecheck/should_fail/T7857.stderr
new file mode 100644
index 0000000000..6fdad87b2a
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T7857.stderr
@@ -0,0 +1,16 @@
+
+T7857.hs:8:11:
+ Could not deduce (PrintfType s0) arising from a use of ‛printf’
+ from the context (PrintfArg t)
+ bound by the inferred type of g :: PrintfArg t => t -> s
+ at T7857.hs:8:1-21
+ The type variable ‛s0’ is ambiguous
+ Note: there are several potential instances:
+ instance [safe] (PrintfArg a, PrintfType r) => PrintfType (a -> r)
+ -- Defined in ‛Text.Printf’
+ instance [safe] PrintfType (IO a) -- Defined in ‛Text.Printf’
+ instance [safe] IsChar c => PrintfType [c]
+ -- Defined in ‛Text.Printf’
+ In the second argument of ‛($)’, namely ‛printf "" i’
+ In the expression: f $ printf "" i
+ In an equation for ‛g’: g i = f $ printf "" i
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index f1bc64f398..d551a152ac 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -303,3 +303,4 @@ test('T7696', normal, compile_fail, [''])
test('T7748a', normal, compile_fail, [''])
test('TcNoNullaryTC', when(compiler_lt('ghc', '7.7'), skip), compile_fail, [''])
test('TcNullaryTCFail', when(compiler_lt('ghc', '7.7'), skip), compile_fail, [''])
+test('T7857', normal, compile_fail, [''])