
#9450: GHC instantiates Data instances before checking hs-boot files -------------------------------------+------------------------------------- Reporter: alanz | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: boot,deriving Operating System: | Architecture: x86_64 (amd64) Unknown/Multiple | Difficulty: Unknown Type of failure: Compile- | Blocked By: time crash | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by simonpj): This is awkward. GHC currently typechecks the source file, and then compares with the hs-boot file for consistency. And indeed, we ''must'' do that, because until we have done at least some typechecking we don't have any type from the source file to compare with those in the hs-boot file. I suppose that the difficulty is that the very act of typechecking the source file leads to an unexpected situation and a crash. I have not worked out the details. I'm not sure how to solve this. One route (which seems like the right one) might be to make the check ''whenever extending the type environment''; that is, as soon as we have got to the point of adding a data type T, or function f, to the environment, at that moment check compatibility. Probably not too hard, but a bit fiddly, and I'm definitely not going to have time to do it soon. And yet it's bad that GHC actually crashes. It should never do that. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9450#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler