Do not allow Typeable on constraints (Trac #9858)
The astonishingly-ingenious trio of Shachaf Ben-Kiki, Ørjan Johansen and Nathan van Doorn managed to persuade GHC 7.10.1 to cough up unsafeCoerce. That is very bad. This patch fixes it by no allowing Typable on Constraint-kinded things. And that seems right, since it is, in effect, a form of impredicative polymorphism, which Typeable definitely doesn't support. We may want to creep back in the direction of allowing Typeable on constraints one day, but this is a good fix for now, and closes a terrible hole.
Showing
- compiler/typecheck/TcInteract.hs 37 additions, 2 deletionscompiler/typecheck/TcInteract.hs
- compiler/types/TypeRep.hs 12 additions, 2 deletionscompiler/types/TypeRep.hs
- testsuite/tests/typecheck/should_fail/T9858a.hs 35 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T9858a.hs
- testsuite/tests/typecheck/should_fail/T9858a.stderr 12 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T9858a.stderr
- testsuite/tests/typecheck/should_fail/all.T 1 addition, 0 deletionstestsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/typecheck/should_run/T9858b.hs 8 additions, 0 deletionstestsuite/tests/typecheck/should_run/T9858b.hs
- testsuite/tests/typecheck/should_run/T9858b.stdout 1 addition, 0 deletionstestsuite/tests/typecheck/should_run/T9858b.stdout
- testsuite/tests/typecheck/should_run/all.T 1 addition, 0 deletionstestsuite/tests/typecheck/should_run/all.T
Loading
Please register or sign in to comment