[GHC] #12451: TemplateHaskell and Data.Typeable - tcIfaceGlobal (local): not found

#12451: TemplateHaskell and Data.Typeable - tcIfaceGlobal (local): not found -------------------------------------+------------------------------------- Reporter: mkloczko | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple TemplateHaskell, Typeable | Architecture: x86_64 | Type of failure: GHC rejects (amd64) | valid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The following code produces an ghc panic error: {{{#!hs {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ScopedTypeVariables #-} module TH where import Language.Haskell.TH import Language.Haskell.TH.Syntax import Data.Typeable usingType :: forall a. Typeable a => a -> Q [Dec] usingType _ = do -- Try to get anything using typeRep. let name = (tyConName $ typeRepTyCon $ typeRep (Proxy :: Proxy a)) `seq` "The name!" -- theF = "The name!" return [FunD (mkName "theF") [Clause [] (NormalB $ LitE $ StringL name ) []]] }}} {{{#!hs {-# LANGUAGE TemplateHaskell #-} module Main where import TH data A = A Int -- Changing the argument to (A 3) does not help. $(usingType (undefined :: A)) main = putStrLn $ theF }}} The error: {{{ ghc: panic! (the 'impossible' happened) (GHC version 8.0.1 for x86_64-unknown-linux): tcIfaceGlobal (local): not found: $tcA [r5m0 :-> Type constructor ‘A’, r5m3 :-> Data constructor ‘A’, r5m9 :-> Identifier ‘A’] }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12451 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12451: TemplateHaskell and Data.Typeable - tcIfaceGlobal (local): not found -------------------------------------+------------------------------------- Reporter: mkloczko | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 8.0.1 Resolution: | Keywords: | TemplateHaskell, Typeable Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: GHC rejects | (amd64) valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * component: Compiler => Template Haskell Comment: Thanks for reporting! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12451#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12451: TemplateHaskell and Data.Typeable - tcIfaceGlobal (local): not found -------------------------------------+------------------------------------- Reporter: mkloczko | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 8.0.1 Resolution: | Keywords: | TemplateHaskell, Typeable Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: GHC rejects | (amd64) valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): In GHC 8.4 and HEAD, the error message has changed: {{{ $ /opt/ghc/head/bin/ghc -fforce-recomp Main.hs [1 of 2] Compiling TH ( TH.hs, TH.o ) [2 of 2] Compiling Main ( Main.hs, Main.o ) GHC error in desugarer lookup in Main: attempting to use module ‘main:Main’ (Main.hs) which is not loaded }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12451#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12451: TemplateHaskell and Data.Typeable - tcIfaceGlobal (local): not found -------------------------------------+------------------------------------- Reporter: mkloczko | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 8.0.1 Resolution: | Keywords: | TemplateHaskell, Typeable Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: GHC rejects | (amd64) valid program | Test Case: Blocked By: | Blocking: Related Tickets: #12452 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * related: => #12452 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12451#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC