[GHC] #13736: GHC panic with DataKinds and TypeOperators

#13736: GHC panic with DataKinds and TypeOperators -------------------------------------+------------------------------------- Reporter: turion | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The following program causes a GHC panic: {{{#!hs {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE KindSignatures #-} import GHC.TypeLits data Proxy (n :: Nat) = Proxy data Foo a = Foo a foo :: Foo (Proxy (2 * 2)) foo = Foo _ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13736 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13736: GHC panic with DataKinds and TypeOperators -------------------------------------+------------------------------------- Reporter: turion | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by turion: @@ -15,0 +15,10 @@ + + The error message is: + + + {{{ + ghc: panic! (the 'impossible' happened) + (GHC version 8.0.2 for x86_64-unknown-linux): + initTc: unsolved constraints + WC {wc_insol = [W] __aBJ :: t_aBI[tau:1] (CHoleCan: _)} + }}} New description: The following program causes a GHC panic: {{{#!hs {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE KindSignatures #-} import GHC.TypeLits data Proxy (n :: Nat) = Proxy data Foo a = Foo a foo :: Foo (Proxy (2 * 2)) foo = Foo _ }}} The error message is: {{{ ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-unknown-linux): initTc: unsolved constraints WC {wc_insol = [W] __aBJ :: t_aBI[tau:1] (CHoleCan: _)} }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13736#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13736: GHC panic with DataKinds and TypeOperators -------------------------------------+------------------------------------- Reporter: turion | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | 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.1, where you'll get this proper error message instead: {{{ $ ~/Software/ghc/inplace/bin/ghc-stage2 Bug.hs [1 of 1] Compiling Main ( Bug.hs, Bug.o ) Bug.hs:1:1: error: The IO action ‘main’ is not defined in module ‘Main’ | 1 | {-# LANGUAGE DataKinds #-} | ^ Bug.hs:11:11: error: • Found hole: _ :: a0 Where: ‘a0’ is an ambiguous type variable • In the first argument of ‘Main.Foo’, namely ‘_’ In the expression: Main.Foo _ In an equation for ‘Main.foo’: Main.foo = Main.Foo _ • Relevant bindings include foo :: Main.Foo (Main.Proxy (2 * 2)) (bound at Bug.hs:11:1) | 11 | foo = Foo _ | ^ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13736#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC