diff options
author | Yuras Shumovich <shumovichy@gmail.com> | 2016-02-16 22:45:13 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-02-16 22:45:21 +0100 |
commit | 5fc06b97b320e98febaa925085dac03e5b01fc5a (patch) | |
tree | d2bd3cc6872ef49db65f4dcbde3f64d9eaac8c94 /testsuite | |
parent | 49c5cb40f049f0a868fa310a240a31b571f40491 (diff) | |
download | haskell-5fc06b97b320e98febaa925085dac03e5b01fc5a.tar.gz |
Suggest candidate instances in error message
See Trac #9611. In "No instance..." error message we suggest instances
for other types with the same occ name. It is usefull e.g. when we have
two different versions of the same package installed.
Test Plan: typecheck/should_fail/tcfail224
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1919
GHC Trac Issues: #9611
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/tcfail224.hs | 8 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/tcfail224.stderr | 7 |
3 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 69df866270..24ce95c68d 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -247,6 +247,7 @@ test('tcfail220', normal, multimod_compile_fail, ['tcfail220.hsig', '-sig-of "Sh test('tcfail221', normal, multimod_compile_fail, ['tcfail221.hsig', '-sig-of "ShouldFail is base:Prelude"']) test('tcfail222', normal, multimod_compile_fail, ['tcfail222.hsig', '-sig-of "ShouldFail is base:Data.STRef"']) test('tcfail223', normal, compile_fail, ['']) +test('tcfail224', normal, compile_fail, ['']) test('SilentParametersOverlapping', normal, compile, ['']) test('FailDueToGivenOverlapping', normal, compile_fail, ['']) diff --git a/testsuite/tests/typecheck/should_fail/tcfail224.hs b/testsuite/tests/typecheck/should_fail/tcfail224.hs new file mode 100644 index 0000000000..d2bddb14d9 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/tcfail224.hs @@ -0,0 +1,8 @@ +module Foo where + +import Prelude hiding( Int ) + +data Int = Int + +f :: Int +f = 3 diff --git a/testsuite/tests/typecheck/should_fail/tcfail224.stderr b/testsuite/tests/typecheck/should_fail/tcfail224.stderr new file mode 100644 index 0000000000..70088e2f3a --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/tcfail224.stderr @@ -0,0 +1,7 @@ + +tcfail224.hs:8:5: error: + • No instance for (Num Int) arising from the literal ‘3’ + There are instances for similar types: + instance Num GHC.Types.Int -- Defined in ‘GHC.Num’ + • In the expression: 3 + In an equation for ‘f’: f = 3 |