[GHC] #9036: ghc: panic! (the 'impossible' happened) (Binder's type (SingI Symbol <a String>) /= RHS type (String))
#9036: ghc: panic! (the 'impossible' happened) (Binder's type (SingI Symbol <a String>) /= RHS type (String)) --------------------------------+--------------------------------------- Reporter: ntc2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Keywords: GHC.TypeLits | Operating System: Linux Architecture: x86 | Type of failure: Compile-time crash Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | --------------------------------+--------------------------------------- Compilation error message: {{{ ghc: panic! (the 'impossible' happened) (GHC version 7.6.3 for i386-unknown-linux): cgLookupPanic (probably invalid Core; try -dcore-lint) cobox{v a212} [lid] static binds for: local binds for: main:Debug.Trace.LogTree.Test.$p1AllShow{v r1pg} [gid[ClassOp]] main:Debug.Trace.LogTree.Test.$p2AllShow{v r1ph} [gid[ClassOp]] main:Debug.Trace.LogTree.Test.$p3AllShow{v r1pi} [gid[ClassOp]] main:Debug.Trace.LogTree.Test.$p4AllShow{v r1pj} [gid[ClassOp]] main:Debug.Trace.LogTree.Test.$p5AllShow{v r1pk} [gid[ClassOp]] main:Debug.Trace.LogTree.Test.$p6AllShow{v r1pl} [gid[ClassOp]] Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} Error in -dcore-lint: {{{ [10 of 10] Compiling Debug.Trace.LogTree.Test ( src/Debug/Trace/LogTree/Test.hs, tmp/Debug/Trace/LogTree/Test.o ) *** Core Lint errors : in result of Desugar (after optimization) *** {-# LINE 122 "src/Debug/Trace/LogTree/Test.hs #-}: Warning: [RHS of $dSingI_a20r :: GHC.TypeLits.SingI GHC.TypeLits.Symbol "h"] The type of this binder doesn't match the type of its RHS: $dSingI_a20r Binder's type: GHC.TypeLits.SingI GHC.TypeLits.Symbol "h" Rhs type: [GHC.Types.Char] }}} So, it looks like it's related to !TypeLits. The full -dcore-lint output is attached. To reproduce: 1. git clone https://github.com/ntc2/haskell-call-trace.git 2. cd haskell-call-trace 3. git checkout break-ghc 3. <install dependencies; see below> 4. make The dependencies from the .cabal file are: {{{ build-depends: base >=4.6 && <4.7 , template-haskell >=2.8 && <2.9 , ghc-prim >=0.3 && <0.4 , parsec >=3.1 && <3.2 , tagged >=0.7 && <0.8 , transformers >=0.3 && <0.4 , mtl >=2.1 && <2.2 }}} The problematic file is https://github.com/ntc2/haskell-call-trace/blob /break-ghc/src/Debug/Trace/LogTree/Test.hs . I was in the middle of a program-wide change when I ran into this GHC panic; I was using the type errors to guide my fixes. The Test.hs is not type correct, but I don't see how the stuff I changed as anything to do with my use of type-level strings (!TypeLits). The code in the previous commit compiles. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9036> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9036: ghc: panic! Binder's type (SingI Symbol <a String>) /= RHS type (String) ---------------------------------------+-------------------------------- Reporter: ntc2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: GHC.TypeLits Operating System: Linux | Architecture: x86 Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+-------------------------------- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9036#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9036: ghc: panic! Binder's type (SingI Symbol <a String>) /= RHS type (String) ---------------------------------------+-------------------------------- Reporter: ntc2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: GHC.TypeLits Operating System: Linux | Architecture: x86 Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+-------------------------------- Comment (by ntc2): The wiki won't let me attach the -dcore-lint output because it's too big (it's about half a MB). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9036#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9036: ghc: panic! Binder's type (SingI Symbol <a String>) /= RHS type (String) ---------------------------------------+-------------------------------- Reporter: ntc2 | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: fixed | Keywords: GHC.TypeLits Operating System: Linux | Architecture: x86 Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+-------------------------------- Changes (by monoidal): * status: new => closed * resolution: => fixed Comment: I reduced your program to a single file {{{ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeFamilies #-} module Debug.Trace.LogTree.Test where class UncurryM t where type GetMonad t :: * -> * class Curry a b where type Curried a b :: * gSimple :: String -> String -> [String] gSimple = simpleLogger (return ()) simpleLogger :: Maybe (GetMonad t after) -> t `Curried` [t] simpleLogger _ _ = undefined }}} which compiled with -O gives the same error in 7.6.3 but 7.8.2 gives a typecheck error. I believe this is another instance of bugs #7729, #8142, #8227. So, the issue is fixed in 7.8 and since 7.6 is not actively developed, I'm closing the ticket. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9036#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9036: ghc: panic! Binder's type (SingI Symbol <a String>) /= RHS type (String) -------------------------------------------------+------------------------- Reporter: ntc2 | Owner: Type: bug | Status: Priority: normal | closed Component: Compiler | Milestone: Resolution: fixed | Version: 7.6.3 Operating System: Linux | Keywords: Type of failure: Compile-time crash | GHC.TypeLits Test Case: | Architecture: x86 indexed_types/should_compile/T9036 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Changes (by simonpj): * testcase: => indexed_types/should_compile/T9036 Comment: Great. I've added the small example as a regression test, just in case. Simon -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9036#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9036: ghc: panic! Binder's type (SingI Symbol <a String>) /= RHS type (String) -------------------------------------------------+------------------------- Reporter: ntc2 | Owner: Type: bug | Status: Priority: normal | closed Component: Compiler | Milestone: Resolution: fixed | Version: 7.6.3 Operating System: Linux | Keywords: Type of failure: Compile-time crash | GHC.TypeLits Test Case: | Architecture: x86 indexed_types/should_compile/T9036 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"c4e9f243398942499c9f5e21318e6ceb048d5880/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="c4e9f243398942499c9f5e21318e6ceb048d5880" Test Trac #9036 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9036#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC