This results in the text: "these potential instance exists:" in error messages.
Expected behavior
There are two issues: 'instance' should be 'instances' and if there is only one instance then it might make sense to show a specialized message: "this potential instance exists:".
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
You can refactor error messages from places like those linked in (1) using a common helper function in Outputable.hs, fixing this bug along the way.
A test case does need to be added. To do this, first come up with a small reproducible example that illustrates the bug in this ticket. Then add it to testsuite/tests/typecheck/should_fail/ along with a corresponding entry in testsuite/tests/typecheck/should_fail/all.T.
Hi @wz1000 , I am doing make test and found other than the test I added (T20122), several tests output also got affected. Do I need to modify their stderr files as well? Or other solutions? If additional information needed, please let me know.
--- should_fail/T4921.run/T4921.stderr.normalised 2021-07-24 22:39:33.261186400 +0800+++ should_fail/T4921.run/T4921.comp.stderr.normalised 2021-07-24 22:39:33.262180600 +0800@@ -3,8 +3,9 @@ Ambiguous type variables ‘a0’, ‘b1’ arising from a use of ‘f’ prevents the constraint ‘(C a0 b1)’ from being solved. Relevant bindings include x :: a0 (bound at T4921.hs:10:1)- Probable fix: use a type annotation to specify what ‘a0’, ‘b1’ should be.- These potential instance exist:+ Probable fix: use a type annotation to specify what ‘a0’,+ ‘b1’ should be.+ This potential instance exists: instance C Int Char -- Defined at T4921.hs:7:10 In the first argument of ‘fst’, namely ‘f’ In the expression: fst f@@ -14,7 +15,7 @@ Ambiguous type variable ‘b0’ arising from a use of ‘f’ prevents the constraint ‘(C Int b0)’ from being solved. Probable fix: use a type annotation to specify what ‘b0’ should be.- These potential instance exist:+ This potential instance exists: instance C Int Char -- Defined at T4921.hs:7:10 In the first argument of ‘fst’, namely ‘f’ In the expression: fst f :: Int*** unexpected failure for T4921(normal)
Now on the Travis validating process.
Edit: cannot trigger travis as described in wiki. I am new to travis and is this wiki still up to date? Anyway, I will try to validate locally before submit the patch.