Significant refactor of Lint
This refactoring of Lint was triggered by #17923, which is fixed by this patch. The main change is this. Instead of lintType :: Type -> LintM LintedKind we now have lintType :: Type -> LintM LintedType Previously, all of typeKind was effectively duplicate in lintType. Moreover, since we have an ambient substitution, we still had to apply the substition here and there, sometimes more than once. It was all very tricky, in the end, and made my head hurt. Now, lintType returns a fully linted type, with all substitutions performed on it. This is much simpler. The same thing is needed for Coercions. Instead of lintCoercion :: OutCoercion -> LintM (LintedKind, LintedKind, LintedType, LintedType, Role) we now have lintCoercion :: Coercion -> LintM LintedCoercion Much simpler! The code is shorter and less bug-prone. There are a lot of knock on effects. But life is now better.
parent
2643ba46
No related branches found
No related tags found
Pipeline #17100 failed
Stage: lint
Stage: quick-build
Stage: build
Stage: full-build
Stage: cleanup
Stage: packaging
Stage: testing
Showing
- compiler/GHC/Core/Lint.hs 473 additions, 493 deletionscompiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Type.hs 8 additions, 3 deletionscompiler/GHC/Core/Type.hs
- testsuite/tests/indexed-types/should_compile/T17923.hs 44 additions, 0 deletionstestsuite/tests/indexed-types/should_compile/T17923.hs
- testsuite/tests/indexed-types/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/indexed-types/should_compile/all.T
Loading
Please register or sign in to comment