[GHC] #14055: Panic on type error inside a type-level newtype (with -XTypeInType)

#14055: Panic on type error inside a type-level newtype (with -XTypeInType) -------------------------------------+------------------------------------- Reporter: luqui | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Keywords: | Operating System: MacOS X Architecture: x86_64 | Type of failure: Compile-time (amd64) | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{#!hs {-# LANGUAGE TypeInType, TypeFamilies #-} newtype X = RollX (() -> X) type family F t :: X where F t = RollX (t -> ()) }}} gives {{{ ghc: panic! (the 'impossible' happened) (GHC version 8.2.1 for x86_64-apple-darwin): repSplitAppTys t_a1po[sk:1] () [] Call stack: CallStack (from HasCallStack): prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable pprPanic, called at compiler/types/Type.hs:808:9 in ghc:Type }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14055 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14055: Panic on type error inside a type-level newtype -------------------------------------+------------------------------------- Reporter: luqui | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by luqui: Old description:
{{{#!hs {-# LANGUAGE TypeInType, TypeFamilies #-}
newtype X = RollX (() -> X)
type family F t :: X where F t = RollX (t -> ()) }}}
gives
{{{ ghc: panic! (the 'impossible' happened) (GHC version 8.2.1 for x86_64-apple-darwin): repSplitAppTys t_a1po[sk:1] () [] Call stack: CallStack (from HasCallStack): prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable pprPanic, called at compiler/types/Type.hs:808:9 in ghc:Type }}}
New description: {{{#!hs {-# LANGUAGE DataKinds, TypeFamilies #-} newtype X = RollX (() -> X) type family F t :: X where F t = RollX (t -> ()) }}} gives {{{ ghc: panic! (the 'impossible' happened) (GHC version 8.2.1 for x86_64-apple-darwin): repSplitAppTys t_a1po[sk:1] () [] Call stack: CallStack (from HasCallStack): prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable pprPanic, called at compiler/types/Type.hs:808:9 in ghc:Type }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14055#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14055: Panic on type error inside a type-level newtype -------------------------------------+------------------------------------- Reporter: luqui | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.2.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * os: MacOS X => Unknown/Multiple * component: Compiler => Compiler (Type checker) * architecture: x86_64 (amd64) => Unknown/Multiple Comment: This doesn't panic on GHC HEAD: {{{ $ ~/Software/ghc3/inplace/bin/ghc-stage2 --interactive Bug.hs GHCi, version 8.3.20170729: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Main ( Bug.hs, interpreted ) Bug.hs:6:18: error: • Expected kind ‘() -> X’, but ‘t -> ()’ has kind ‘*’ • In the first argument of ‘RollX’, namely ‘(t -> ())’ In the type ‘RollX (t -> ())’ In the type family declaration for ‘F’ | 6 | F t = RollX (t -> ()) | ^^^^^^^ }}} 8e15e3d370e9c253ae0dbb330e25b72cb00cdb76 likely fixed this. I'll add a regression test. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14055#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14055: Panic on type error inside a type-level newtype
-------------------------------------+-------------------------------------
Reporter: luqui | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 8.2.1
checker) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash or panic | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ryan Scott

#14055: Panic on type error inside a type-level newtype -------------------------------------+------------------------------------- Reporter: luqui | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler (Type | Version: 8.2.1 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | typecheck/should_fail/T14055 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * testcase: => typecheck/should_fail/T14055 * resolution: => fixed * milestone: => 8.4.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14055#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC