Make CallStacks work better with RebindableSyntax
As #19918 pointed out, the CallStack mechanism didn't work well with RebindableSyntax. This patch improves matters. See GHC.Tc.Types.Evidence Note [Overview of implicit CallStacks] * New predicate isPushCallStackOrigin distinguishes when a CallStack constraint should be solved "directly" or by pushing an item on the stack. * The constructor EvCsPushCall now has a FastString, which can describe not only a function call site, but also things like "the literal 42" or "an if-then-else expression". * I also fixed #20126 thus: exprCtOrigin (HsIf {}) = IfThenElseOrigin (Previously it was "can't happen".)
Showing
- compiler/GHC/Hs/Expr.hs 5 additions, 3 deletionscompiler/GHC/Hs/Expr.hs
- compiler/GHC/Tc/Gen/Arrow.hs 4 additions, 4 deletionscompiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Solver/Canonical.hs 4 additions, 2 deletionscompiler/GHC/Tc/Solver/Canonical.hs
- compiler/GHC/Tc/Solver/Types.hs 5 additions, 3 deletionscompiler/GHC/Tc/Solver/Types.hs
- compiler/GHC/Tc/Types/EvTerm.hs 2 additions, 3 deletionscompiler/GHC/Tc/Types/EvTerm.hs
- compiler/GHC/Tc/Types/Evidence.hs 43 additions, 22 deletionscompiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs 48 additions, 6 deletionscompiler/GHC/Tc/Types/Origin.hs
- testsuite/tests/rebindable/T19918.hs 72 additions, 0 deletionstestsuite/tests/rebindable/T19918.hs
- testsuite/tests/rebindable/T19918.stderr 2 additions, 0 deletionstestsuite/tests/rebindable/T19918.stderr
- testsuite/tests/rebindable/T19918.stdout 16 additions, 0 deletionstestsuite/tests/rebindable/T19918.stdout
- testsuite/tests/rebindable/T20126.hs 13 additions, 0 deletionstestsuite/tests/rebindable/T20126.hs
- testsuite/tests/rebindable/T20126.stderr 6 additions, 0 deletionstestsuite/tests/rebindable/T20126.stderr
- testsuite/tests/rebindable/all.T 2 additions, 0 deletionstestsuite/tests/rebindable/all.T
Loading
Please register or sign in to comment