[commit: ghc] master: Test Trac #4921 (30d2605)
git at git.haskell.org
git at git.haskell.org
Tue Dec 2 13:27:40 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/30d260586d46466419b109057ec87d4f097331a1/ghc
>---------------------------------------------------------------
commit 30d260586d46466419b109057ec87d4f097331a1
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Tue Dec 2 12:08:57 2014 +0000
Test Trac #4921
>---------------------------------------------------------------
30d260586d46466419b109057ec87d4f097331a1
testsuite/tests/typecheck/should_fail/T4921.hs | 12 ++++++++++++
testsuite/tests/typecheck/should_fail/T4921.stderr | 19 +++++++++++++++++++
testsuite/tests/typecheck/should_fail/all.T | 1 +
3 files changed, 32 insertions(+)
diff --git a/testsuite/tests/typecheck/should_fail/T4921.hs b/testsuite/tests/typecheck/should_fail/T4921.hs
new file mode 100644
index 0000000..b024967
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T4921.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+module T4921 where
+
+class C a b where
+ f :: (a,b)
+
+instance C Int Char where
+ f = undefined
+
+x = fst f
+
+y = fst f :: Int
diff --git a/testsuite/tests/typecheck/should_fail/T4921.stderr b/testsuite/tests/typecheck/should_fail/T4921.stderr
new file mode 100644
index 0000000..c304b05
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T4921.stderr
@@ -0,0 +1,19 @@
+
+T4921.hs:10:9:
+ No instance for (C a0 b1) arising from a use of ‘f’
+ The type variables ‘a0’, ‘b1’ are ambiguous
+ Relevant bindings include x :: a0 (bound at T4921.hs:10:1)
+ Note: there is a potential instance available:
+ instance C Int Char -- Defined at T4921.hs:7:10
+ In the first argument of ‘fst’, namely ‘f’
+ In the expression: fst f
+ In an equation for ‘x’: x = fst f
+
+T4921.hs:12:9:
+ No instance for (C Int b0) arising from a use of ‘f’
+ The type variable ‘b0’ is ambiguous
+ Note: there is a potential instance available:
+ instance C Int Char -- Defined at T4921.hs:7:10
+ In the first argument of ‘fst’, namely ‘f’
+ In the expression: fst f :: Int
+ In an equation for ‘y’: y = fst f :: Int
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 7d1e558..d3c8941 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -345,3 +345,4 @@ test('T9201', normal, compile_fail, [''])
test('T9109', normal, compile_fail, [''])
test('T9497d', normal, compile_fail, ['-fdefer-type-errors -fno-defer-typed-holes'])
test('T8044', normal, compile_fail, [''])
+test('T4921', normal, compile_fail, [''])
More information about the ghc-commits
mailing list