
#13932: GHC and GHCi dumps "panic!" ("initTc: unsolved constraints") -------------------------------------+------------------------------------- Reporter: aiya000 | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: duplicate | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13106 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => duplicate * related: => #13106 Comment: Thanks for the bug report. This is a duplicate of #13106, and has been fixed in GHC 8.2. For what it's worth, this panic sometimes happens when you have out-of- scope identifiers. Here's the error message you get on GHC 8.2: {{{ [6 of 6] Compiling Maru.Main ( src/Maru/Main.hs, interpreted ) src/Maru/Main.hs:42:15: error: • Variable not in scope: makeLensesWith :: t1 -> String -> Name -> DecsQ • Perhaps you meant ‘makeLensesA’ (line 42) Perhaps you want to add ‘makeLensesWith’ to the import list in the import of ‘Lens.Micro.TH’ (src/Maru/Main.hs:26:1-45). | 42 | makeLensesA = makeLensesWith (lensRules & lensField .~ addSuffix) | ^^^^^^^^^^^^^^ src/Maru/Main.hs:42:31: error: • Variable not in scope: lensRules • Perhaps you want to add ‘lensRules’ to the import list in the import of ‘Lens.Micro.TH’ (src/Maru/Main.hs:26:1-45). | 42 | makeLensesA = makeLensesWith (lensRules & lensField .~ addSuffix) | ^^^^^^^^^ src/Maru/Main.hs:42:41: error: Variable not in scope: (&) :: t5 -> (((Name -> [Name] -> Name -> [DefName]) -> f0 (Name -> [Name] -> Name -> [DefName])) -> Lens.Micro.TH.LensRules -> f0 Lens.Micro.TH.LensRules) -> t3 | 42 | makeLensesA = makeLensesWith (lensRules & lensField .~ addSuffix) | ^ src/Maru/Main.hs:42:53: error: • Variable not in scope: (.~) :: t3 -> (Name -> [Name] -> Name -> [DefName]) -> t1 • Perhaps you meant ‘.’ (imported from Prelude) | 42 | makeLensesA = makeLensesWith (lensRules & lensField .~ addSuffix) | ^^ src/Maru/Main.hs:54:1: error: GHC stage restriction: ‘makeLensesA’ is used in a top-level splice, quasi-quote, or annotation, and must be imported, not defined locally | 54 | makeLensesA ''CliOptions | ^^^^^^^^^^^ }}} So ultimately, the root of the issue is that you're trying to use things which aren't imported (e.g., `makeLensesWith`). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13932#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler