As part of the ghc-9.0 branch, a fix was introduced to keep the ignore-exports option working, but this fix was mistakenly dropped in later branches. Furthermore, the test introduced in #1082 to prevent regressions was also broken at a later point. This PR reintroduces the fix, fixes the old HTML test, and introduces a new hoogle test.
I'll open a similar PR targeting the ghc-9.4 branch. I don't know, however, how to ensure that this fixes also lands on main (or ghc-head?), and how to prevent the tests from just being ignored or "fixed" in the future.
Implementation
The fullModuleContents function iterates on all declarations of the module, but only keeps declarations for which it finds an AvailInfo, obtained from GHC's type-checker's output (see tcg_exports). However, that list only contains the AvailInfo information for declarations that are exported out of the module. To prevent non-exported declarations from being ignored when we actually request them, this PR takes the same approach as b93c6351afdfaf452ad9830a5f8536a353320a84 and crafts a simple AvailInfo for each declaration to be used in lieu of the raw tcg_exports list.
Steps to verify
See #1531 for a repro case.
Caveats
cabal test hypsrc-test fails on this branch, but also fails on the upstream, and is therefore not caused by this PR.
Description
As part of the
ghc-9.0
branch, a fix was introduced to keep theignore-exports
option working, but this fix was mistakenly dropped in later branches. Furthermore, the test introduced in #1082 to prevent regressions was also broken at a later point. This PR reintroduces the fix, fixes the old HTML test, and introduces a new hoogle test.I'll open a similar PR targeting the ghc-9.4 branch. I don't know, however, how to ensure that this fixes also lands on
main
(orghc-head
?), and how to prevent the tests from just being ignored or "fixed" in the future.Implementation
The
fullModuleContents
function iterates on all declarations of the module, but only keeps declarations for which it finds anAvailInfo
, obtained from GHC's type-checker's output (seetcg_exports
). However, that list only contains theAvailInfo
information for declarations that are exported out of the module. To prevent non-exported declarations from being ignored when we actually request them, this PR takes the same approach as b93c6351afdfaf452ad9830a5f8536a353320a84 and crafts a simpleAvailInfo
for each declaration to be used in lieu of the rawtcg_exports
list.Steps to verify
See #1531 for a repro case.
Caveats
cabal test hypsrc-test
fails on this branch, but also fails on the upstream, and is therefore not caused by this PR.