
#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, did some reading of haskell-src-exts-qq and it's the same problem as https://github.com/ekmett/lens/issues/496 and #9745: {{{ -- | The generic functions in 'Language.Haskell.TH.Quote' don't use global -- names for syntax constructors. This has the unfortunate effect of breaking -- quotation when the haskell-src-exts syntax module is imported qualified. -- The solution is to set the flavour of all names to 'NameG'. qualify :: Name -> Name -- Need special cases for constructors used in string literals. Assume nearly -- all else is a datatype defined in Syntax module of haskell-src-exts. qualify n | ":" <- nameBase n = '(:) | "[]" <- nameBase n = '[] | "(,)" <- nameBase n = '(,) | "Nothing" <- nameBase n = 'Nothing | "Just" <- nameBase n = 'Just | "SrcLoc" <- nameBase n = 'Hs.SrcLoc | "Boxed" <- nameBase n = 'Hs.Boxed | otherwise = Name (mkOccName (nameBase n)) flavour where pkg = "haskell-src-exts-" ++ VERSION_haskell_src_exts flavour = NameG VarName (mkPkgName pkg) (mkModName "Language.Haskell.Exts.Syntax") }}} This is not going to work with package keys. It seems pretty clear to me that we should improve the error message in this case, though it's not altogether clear where it should live (probably the TH code?) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10279#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler