GHC.Tc.TyCl.checkValidTyCl, we now do a call to a new function
checkTyConConsistentWithBoot, that attempts to find a matching definition in the boot info. If it does, it calls
GHC.Tc.Module.checkBootDeclM, which errors if the two declarations do not match. This patch also adds a test that replicates the original issue in
typecheck/T16127 (based on my small repro case).
I have checked that this test failed against
release/ghc-9.8 with the "expected" panic.
This is my first patch against GHC, and i have in consequence a few questions:
checkTyConConsistentWithBootmatch the naming convention? Should it be in snake case since it's not exported?
checkTyConConsistentWithBootdoes not check whether we are currently compiling a boot file; i think that check isn't required, because if we are, then there will not be any boot info in the
TcGblEnv, is that correct?
- would it be possible to now remove the call to
Module.checkHiBootIface'.check_export, given that we should always have done that check by the time we reach that function? if it is possible: should we? or would it be better to leave the check as a precaution?