
#10279: panic on haskell-src-exts -------------------------------------+------------------------------------- Reporter: throwaway123 | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by ezyang): OK, fixing this requires a bit of refactoring, but it's not clear which one is best: 1. One possibility is to fix the code in Language.Haskell.TH to check if a module is valid when it is being created. Unfortunately, this means `Module` has to be created in the `Q` monad, and currently it is not. 2. Another possibility is to check when we are converting the modules, in `cvtName`. Unfortunately, currently the `CvtM` monad is a simple error monad, and does not live in `TcM`, so I can't actually load interface files during the conversion. So doing this conversion would mean `CvtM` turns into yet another `TcRnM` alias, and I'm less than keen to monadify code just for this one use case. 3. Finally, we can add a final "lint" pass on the generated code which, among other things, makes sure the error messages make sense. Since this is done at the splice site, we still have the location information of the splice available. 4. Augment generated TC splices with splice location, so if we run into an error in spliced code, we properly report where the splice was generated from. Maybe we should just do this anyway? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10279#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler