Inform hole substitutions of typeclass constraints (fixes #14273).
This implements SPJ's suggestion on the ticket (#14273). We find the relevant constraints (ones that whose free unification variables are all mentioned in the type of the hole), and then clone the free unification variables of the hole and the relevant constraints. We then add a subsumption constraints and run the simplifier, and then check whether all the constraints were solved. Reviewers: bgamari Reviewed By: bgamari Subscribers: RyanGlScott, rwbarton, thomie, carter GHC Trac Issues: #14273 Differential Revision: https://phabricator.haskell.org/D4315 (cherry picked from commit 1e14fd3e)
Showing
- compiler/typecheck/TcErrors.hs 162 additions, 109 deletionscompiler/typecheck/TcErrors.hs
- compiler/typecheck/TcRnTypes.hs 9 additions, 4 deletionscompiler/typecheck/TcRnTypes.hs
- compiler/typecheck/TcSimplify.hs 12 additions, 4 deletionscompiler/typecheck/TcSimplify.hs
- compiler/typecheck/TcSimplify.hs-boot 3 additions, 3 deletionscompiler/typecheck/TcSimplify.hs-boot
- testsuite/tests/ghci/scripts/T8353.stderr 5 additions, 0 deletionstestsuite/tests/ghci/scripts/T8353.stderr
- testsuite/tests/th/T10267.stderr 5 additions, 0 deletionstestsuite/tests/th/T10267.stderr
- testsuite/tests/th/all.T 1 addition, 1 deletiontestsuite/tests/th/all.T
- testsuite/tests/typecheck/should_compile/T13050.stderr 6 additions, 0 deletionstestsuite/tests/typecheck/should_compile/T13050.stderr
- testsuite/tests/typecheck/should_compile/T14273.hs 13 additions, 0 deletionstestsuite/tests/typecheck/should_compile/T14273.hs
- testsuite/tests/typecheck/should_compile/T14273.stderr 80 additions, 0 deletionstestsuite/tests/typecheck/should_compile/T14273.stderr
- testsuite/tests/typecheck/should_compile/T14590.stderr 10 additions, 0 deletionstestsuite/tests/typecheck/should_compile/T14590.stderr
- testsuite/tests/typecheck/should_compile/T9497a.stderr 1 addition, 0 deletionstestsuite/tests/typecheck/should_compile/T9497a.stderr
- testsuite/tests/typecheck/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_compile/hole_constraints.stderr 7 additions, 1 deletion...te/tests/typecheck/should_compile/hole_constraints.stderr
- testsuite/tests/typecheck/should_compile/holes.stderr 445 additions, 3 deletionstestsuite/tests/typecheck/should_compile/holes.stderr
- testsuite/tests/typecheck/should_compile/holes2.stderr 19 additions, 5 deletionstestsuite/tests/typecheck/should_compile/holes2.stderr
- testsuite/tests/typecheck/should_compile/holes3.stderr 445 additions, 3 deletionstestsuite/tests/typecheck/should_compile/holes3.stderr
- testsuite/tests/typecheck/should_compile/valid_substitutions.hs 20 additions, 2 deletions...ite/tests/typecheck/should_compile/valid_substitutions.hs
- testsuite/tests/typecheck/should_compile/valid_substitutions.stderr 217 additions, 20 deletions...tests/typecheck/should_compile/valid_substitutions.stderr
- testsuite/tests/typecheck/should_compile/valid_substitutions_interactions.hs 15 additions, 0 deletions...echeck/should_compile/valid_substitutions_interactions.hs
Loading
Please register or sign in to comment