How do I get warnings out of GHC.typecheckModule with GHC 9.12?

Erdi, Gergo Gergo.Erdi at sc.com
Tue Feb 25 06:59:04 UTC 2025


PUBLIC

Hi,

I'm trying to use GHC.typecheckModule to typecheck a module. On GHC 9.8, this function used to expose renamer/typechecker-originating warnings to the GhcMonad that it is run in. However, as of e7a956623b7d71e50fa86fee83459d2611c423b8, the underlying function hscTypecheckRename has been refactored and now seems to discard warnings.

At least, that's my read of the situation. End-to-end, what I'm seeing is that using GHC.typecheckModule, I can see the warnings come out from hscTypechekcRenameWithDiagnostics, but they never make it to printOrThrow. So how is GHC.typecheckModule supposed to be used by API clients in such a way that warnings are still passed to the logger stack?

Thanks,
            Gergo

----------------------------------------------------------------------
This email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please delete all copies and notify the sender immediately. You may wish to refer to the incorporation details of Standard Chartered PLC, Standard Chartered Bank and their subsidiaries together with Standard Chartered Bank’s Privacy Policy via our public website.

----------------------------------------------------------------------
This email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please delete all copies and notify the sender immediately. You may wish to refer to the incorporation details of Standard Chartered PLC, Standard Chartered Bank and their subsidiaries together with Standard Chartered Bank’s Privacy Policy via our main Standard Chartered PLC (UK) website at sc. com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20250225/0e479d35/attachment.html>


More information about the ghc-devs mailing list