summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-08-22 10:00:20 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2018-08-23 11:40:51 +0100
commit8c7f90abcc1e8f9f29b751f23174e8db89ba6983 (patch)
tree09ee6f191eef2ddff8e192bce42b80be9c254a69 /testsuite
parentdb6f1d9cfc74690798645a7cc5b25040c36bb35d (diff)
downloadhaskell-8c7f90abcc1e8f9f29b751f23174e8db89ba6983.tar.gz
Fix a typo in TcValidity.checkFamInstRhs
In error message generation we were using the wrong type constructor in inst_head. Result: the type became ill-kinded, and that sent the compiler into a loop. A separate patch fixes the loop. This patch fixes the actual bug -- Trac #15473. I also improved the "occurs more often" error message a bit. But it's still pretty terrible: * Variable ‘a’ occurs more often in the type family application ‘Undefined’ than in the instance head ‘LetInterleave xs t ts is y z’ It looks like nonsense, but all becomes clear if you use -fprint-explicit-kinds. Really we should fix this by spotting when invisible arguments are involved and at least suggesting -fprint-explicit-kinds.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/typecheck/should_compile/T15473.stderr8
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T2
2 files changed, 9 insertions, 1 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T15473.stderr b/testsuite/tests/typecheck/should_compile/T15473.stderr
new file mode 100644
index 0000000000..6fdeaa115c
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T15473.stderr
@@ -0,0 +1,8 @@
+
+T15473.hs:11:3: error:
+ • Variable ‘a’ occurs more often
+ in the type family application ‘Undefined’
+ than in the instance head ‘LetInterleave xs t ts is y z’
+ (Use UndecidableInstances to permit this)
+ • In the equations for closed type family ‘LetInterleave’
+ In the type family declaration for ‘LetInterleave’
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 75f9aba433..64df3a89d4 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -647,5 +647,5 @@ test('T15431a', normal, compile, [''])
test('T15428', normal, compile, [''])
test('T15412', normal, compile, [''])
test('T15141', normal, compile, [''])
-test('T15473', expect_broken(15473), compile, [''])
+test('T15473', normal, compile_fail, [''])
test('T15499', normal, compile, [''])