Remove the wrapper/coercion-passing logic for submultiplicity checks
Instead, we use a dedicated DelayedError, which is emitted systematically on submultiplicity checks, but is suppressed if we can indeed solve the submultiplicity constraint with a reflexivity coercion. This way, we don't have to return anything from `tcSubMult`, which now looks like a regular constraint check, the rest is implementation detail. This removes all of the strange boilerplate that I'd been struggling with under the previous implementation. Even if submultiplicity checks are not properly constraints, this way it's contained entirely within a `WantedConstraint`. Much more pleasant. Closes #25128.
Showing
- compiler/GHC/Hs/Pat.hs 1 addition, 1 deletioncompiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Syn/Type.hs 0 additions, 1 deletioncompiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Utils.hs 0 additions, 1 deletioncompiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Binds.hs 0 additions, 5 deletionscompiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs 0 additions, 4 deletionscompiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs 0 additions, 2 deletionscompiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs 4 additions, 6 deletionscompiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Utils.hs 1 addition, 11 deletionscompiler/GHC/HsToCore/Utils.hs
- compiler/GHC/Tc/Errors.hs 39 additions, 18 deletionscompiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs 4 additions, 0 deletionscompiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs 2 additions, 0 deletionscompiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Arrow.hs 8 additions, 8 deletionscompiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Gen/Bind.hs 35 additions, 53 deletionscompiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Expr.hs 13 additions, 15 deletionscompiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Match.hs 27 additions, 41 deletionscompiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs 28 additions, 47 deletionscompiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Solver.hs 11 additions, 5 deletionscompiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/TyCl/Utils.hs 1 addition, 1 deletioncompiler/GHC/Tc/TyCl/Utils.hs
- compiler/GHC/Tc/Types/Constraint.hs 16 additions, 1 deletioncompiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/Evidence.hs 1 addition, 12 deletionscompiler/GHC/Tc/Types/Evidence.hs
Loading