Help with debugging a batch mode (or type checker) bug
Simon Peyton Jones
simonpj at microsoft.com
Mon Oct 14 21:35:07 UTC 2019
In --make mode, after compiling module M, rather than serialising M.hi and the deserialising and typechecking it, we simply use the type environment generated by compiling M and put it into M's entry of the Home Package Table (HPT).
But we have to take care to ensure that the IdInfo in that type-env matches the IdInfo that would be obtained by reading M.hi. This is the tidy_type_env returned by TidyPgm.tidyPgm.
Now, in your cafInfo work you are working out the CAFFy-ness of Ids later, and popping this info into M's ModIface. But of course, in --make mode, you must _also_ put that same info into M's md_types type envt in the ModDetails returned by tidyPgm.
I bet that omitting that step is the problem.
| -----Original Message-----
| From: ghc-devs <ghc-devs-bounces at haskell.org> On Behalf Of Ömer Sinan
| Sent: 14 October 2019 20:31
| To: ghc-devs <ghc-devs at haskell.org>
| Subject: Help with debugging a batch mode (or type checker) bug
| In !1304 I'm currently having a bug where I get correct IdInfos for
| imported Ids in one-shot mode (-c), but not when I use batch mode (--
| make). If I add a few prints I can see that in hscIncrementalCompile
| right before hscIncrementalFrontend the hsc_HPT has the correct IdInfos
| for the imported Ids, but somehow in the desugarer output the IdInfo is
| lost. Can anyone point me to the right places in the typechecker or the
| desugarer for me to look at?
| ghc-devs mailing list
| ghc-devs at haskell.org
More information about the ghc-devs