Project 'TerrorJack/ghc' was moved to 'haskell-wasm/ghc'. Please update any links and bookmarks that may still have the old path.
Flattener preserves synonyms, rewriteEvidence can drop buggy "optimisation"
There was a special case in rewriteEvidence, looking like: = return (Just (if ctEvPred old_ev `tcEqType` new_pred then old_ev else old_ev { ctev_pred = new_pred })) But this was wrong: old_pred and new_pred might differ in the kind of a TyVar occurrence, in which case tcEqType would not notice, but we really, really want new_pred. This caused Trac #8913. I solved this by dropping the whole test, and instead making the flattener preserve type synonyms. This was easy because TcEvidence has TcTyConAppCo which (unlike) Coercion, handles synonyms. (cherry picked from commit 6ae678e3)
Showing
- compiler/typecheck/TcCanonical.lhs 14 additions, 9 deletionscompiler/typecheck/TcCanonical.lhs
- compiler/typecheck/TcSMonad.lhs 16 additions, 15 deletionscompiler/typecheck/TcSMonad.lhs
- testsuite/tests/indexed-types/should_compile/T8913.hs 16 additions, 0 deletionstestsuite/tests/indexed-types/should_compile/T8913.hs
- testsuite/tests/indexed-types/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/indexed-types/should_compile/all.T
- testsuite/tests/simplCore/should_compile/simpl017.stderr 4 additions, 10 deletionstestsuite/tests/simplCore/should_compile/simpl017.stderr
Loading
Please register or sign in to comment