Ensure that insolubles are fully rewritten
I was alerted to this by Trac #12468 and #11325. We were treating insolubles (and "hole" constraints are treated as insoluble) inconsistently. In some places we were carefully rewriting them e.g. Note [Make sure that insolubles are fully rewritten] in TcCanonical. But in TcSimplify we weren't feeding them into the solver. As a result, "hole" constraints were not being rewritten, which some users found confusing, and I think rightly so. This patch also fixes a bug in TcSMonad.emitInsoluble, in which two different "hole" constriants could be treated (bogusly) as duplicates, thereby losing one.
Showing
- compiler/typecheck/TcCanonical.hs 1 addition, 1 deletioncompiler/typecheck/TcCanonical.hs
- compiler/typecheck/TcRnTypes.hs 9 additions, 6 deletionscompiler/typecheck/TcRnTypes.hs
- compiler/typecheck/TcSMonad.hs 27 additions, 11 deletionscompiler/typecheck/TcSMonad.hs
- compiler/typecheck/TcSimplify.hs 18 additions, 10 deletionscompiler/typecheck/TcSimplify.hs
- testsuite/tests/gadt/T12468.hs 9 additions, 0 deletionstestsuite/tests/gadt/T12468.hs
- testsuite/tests/gadt/T12468.stderr 6 additions, 0 deletionstestsuite/tests/gadt/T12468.stderr
- testsuite/tests/gadt/all.T 1 addition, 0 deletionstestsuite/tests/gadt/all.T
- testsuite/tests/typecheck/should_compile/hole_constraints.stderr 2 additions, 2 deletions...te/tests/typecheck/should_compile/hole_constraints.stderr
Loading
Please register or sign in to comment