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.
Showing
- compiler/typecheck/TcValidity.hs 14 additions, 10 deletionscompiler/typecheck/TcValidity.hs
- testsuite/tests/typecheck/should_compile/T15473.stderr 8 additions, 0 deletionstestsuite/tests/typecheck/should_compile/T15473.stderr
- testsuite/tests/typecheck/should_compile/all.T 1 addition, 1 deletiontestsuite/tests/typecheck/should_compile/all.T
Loading
Please register or sign in to comment