summaryrefslogtreecommitdiff
path: root/testsuite/tests/partial-sigs/should_fail
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2020-12-08 13:50:42 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-12-20 20:46:31 -0500
commit995a8f9d2bd0e98480a8c60498fdfff1fb8de009 (patch)
tree61242096fd19d009128a59fd22a09d66a656fa0d /testsuite/tests/partial-sigs/should_fail
parent35fa0786b6ded2420f0a07446c8e45bff9bb01e0 (diff)
downloadhaskell-995a8f9d2bd0e98480a8c60498fdfff1fb8de009.tar.gz
Kill floatEqualities completely
This patch delivers on #17656, by entirel killing off the complex floatEqualities mechanism. Previously, floatEqualities would float an equality out of an implication, so that it could be solved at an outer level. But now we simply do unification in-place, without floating the constraint, relying on level numbers to determine untouchability. There are a number of important new Notes: * GHC.Tc.Utils.Unify Note [Unification preconditions] describes the preconditions for unification, including both skolem-escape and touchability. * GHC.Tc.Solver.Interact Note [Solve by unification] describes what we do when we do unify * GHC.Tc.Solver.Monad Note [The Unification Level Flag] describes how we control solver iteration under this new scheme * GHC.Tc.Solver.Monad Note [Tracking Given equalities] describes how we track when we have Given equalities * GHC.Tc.Types.Constraint Note [HasGivenEqs] is a new explanation of the ic_given_eqs field of an implication A big raft of subtle Notes in Solver, concerning floatEqualities, disappears. Main code changes: * GHC.Tc.Solver.floatEqualities disappears entirely * GHC.Tc.Solver.Monad: new fields in InertCans, inert_given_eq_lvl and inert_given_eq, updated by updateGivenEqs See Note [Tracking Given equalities]. * In exchange for updateGivenEqa, GHC.Tc.Solver.Monad.getHasGivenEqs is much simpler and more efficient * I found I could kill of metaTyVarUpdateOK entirely One test case T14683 showed a 5.1% decrease in compile-time allocation; and T5631 was down 2.2%. Other changes were small. Metric Decrease: T14683 T5631
Diffstat (limited to 'testsuite/tests/partial-sigs/should_fail')
-rw-r--r--testsuite/tests/partial-sigs/should_fail/ScopedNamedWildcardsBad.stderr13
1 files changed, 9 insertions, 4 deletions
diff --git a/testsuite/tests/partial-sigs/should_fail/ScopedNamedWildcardsBad.stderr b/testsuite/tests/partial-sigs/should_fail/ScopedNamedWildcardsBad.stderr
index 713bdc65c3..ee618dff56 100644
--- a/testsuite/tests/partial-sigs/should_fail/ScopedNamedWildcardsBad.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/ScopedNamedWildcardsBad.stderr
@@ -1,6 +1,11 @@
-ScopedNamedWildcardsBad.hs:8:21: error:
+ScopedNamedWildcardsBad.hs:11:15: error:
• Couldn't match expected type ‘Bool’ with actual type ‘Char’
- • In the first argument of ‘not’, namely ‘x’
- In the expression: not x
- In an equation for ‘v’: v = not x
+ • In the first argument of ‘g’, namely ‘'x'’
+ In the expression: g 'x'
+ In the expression:
+ let
+ v = not x
+ g :: _a -> _a
+ g x = x
+ in (g 'x')