PmCheck: Big refactor using guard tree variants more closely following source syntax (#18565)
Previously, we desugared and coverage checked plain guard trees as described in Lower Your Guards. That caused (in !3849) quite a bit of pain when we need to partially recover tree structure of the input syntax to return covered sets for long-distance information, for example. In this refactor, I introduced a guard tree variant for each relevant source syntax component of a pattern-match (mainly match groups, match, GRHS, empty case, pattern binding). I made sure to share as much coverage checking code as possible, so that the syntax-specific checking functions are just wrappers around the more substantial checking functions for the LYG primitives (`checkSequence`, `checkGrds`). The refactoring payed off in clearer code and elimination of all panics related to assumed guard tree structure and thus fixes #18565. I also took the liberty to rename and re-arrange the order of functions and comments in the module, deleted some dead and irrelevant Notes, wrote some new ones and gave an overview module haddock.
parent
c7364154
No related branches found
No related tags found
Pipeline #23984 passed with warnings
Stage: lint
Stage: quick-build
Stage: build
Stage: full-build
Stage: cleanup
Stage: packaging
Stage: testing
Showing
- compiler/GHC/Data/OrdList.hs 49 additions, 4 deletionscompiler/GHC/Data/OrdList.hs
- compiler/GHC/HsToCore/Binds.hs 7 additions, 7 deletionscompiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Expr.hs 2 additions, 2 deletionscompiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs 3 additions, 3 deletionscompiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/PmCheck.hs 884 additions, 832 deletionscompiler/GHC/HsToCore/PmCheck.hs
- compiler/GHC/HsToCore/PmCheck/Oracle.hs 1 addition, 20 deletionscompiler/GHC/HsToCore/PmCheck/Oracle.hs
- compiler/GHC/HsToCore/PmCheck/Types.hs 3 additions, 0 deletionscompiler/GHC/HsToCore/PmCheck/Types.hs
- compiler/GHC/Tc/Types.hs 1 addition, 1 deletioncompiler/GHC/Tc/Types.hs
- compiler/GHC/Utils/Misc.hs 2 additions, 3 deletionscompiler/GHC/Utils/Misc.hs
- testsuite/tests/deSugar/should_compile/ds020.stderr 8 additions, 0 deletionstestsuite/tests/deSugar/should_compile/ds020.stderr
- testsuite/tests/module/all.T 1 addition, 1 deletiontestsuite/tests/module/all.T
- testsuite/tests/pmcheck/should_compile/T18572.hs 2 additions, 2 deletionstestsuite/tests/pmcheck/should_compile/T18572.hs
- testsuite/tests/rename/should_compile/T7085.stderr 4 additions, 0 deletionstestsuite/tests/rename/should_compile/T7085.stderr
- testsuite/tests/unboxedsums/all.T 1 addition, 1 deletiontestsuite/tests/unboxedsums/all.T
Loading
Please register or sign in to comment