[GHC] #16347: GHC HEAD regression: piResultTys1

#16347: GHC HEAD regression: piResultTys1 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: Component: Compiler | Version: 8.7 (Type checker) | Keywords: TypeInType | 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: -------------------------------------+------------------------------------- The following program typechecks on GHC 8.0.2 through 8.6.3, but panics on HEAD: {{{#!hs {-# LANGUAGE GADTs #-} {-# LANGUAGE TypeInType #-} module Bug where import Data.Kind import Data.Proxy data T f :: f Type -> Type where MkT :: T f a }}} {{{ $ ~/Software/ghc4/inplace/bin/ghc-stage2 Bug.hs [1 of 1] Compiling Bug ( Bug.hs, Bug.o ) ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.7.20190219 for x86_64-unknown-linux): piResultTys1 k_a10k[tau:1] [*] Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler/utils/Outputable.hs:1159:37 in ghc:Outputable pprPanic, called at compiler/types/Type.hs:1063:5 in ghc:Type }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16347 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16347: GHC HEAD regression: piResultTys1 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: Component: Compiler (Type | Version: 8.7 checker) | Resolution: | Keywords: TypeInType 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: | -------------------------------------+------------------------------------- Description changed by RyanGlScott: Old description:
The following program typechecks on GHC 8.0.2 through 8.6.3, but panics on HEAD:
{{{#!hs {-# LANGUAGE GADTs #-} {-# LANGUAGE TypeInType #-} module Bug where
import Data.Kind import Data.Proxy
data T f :: f Type -> Type where MkT :: T f a }}} {{{ $ ~/Software/ghc4/inplace/bin/ghc-stage2 Bug.hs [1 of 1] Compiling Bug ( Bug.hs, Bug.o ) ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.7.20190219 for x86_64-unknown-linux): piResultTys1 k_a10k[tau:1] [*] Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler/utils/Outputable.hs:1159:37 in ghc:Outputable pprPanic, called at compiler/types/Type.hs:1063:5 in ghc:Type }}}
New description: The following program typechecks on GHC 8.0.2 through 8.6.3, but panics on HEAD: {{{#!hs {-# LANGUAGE GADTs #-} {-# LANGUAGE TypeInType #-} module Bug where import Data.Kind data T f :: f Type -> Type where MkT :: T f a }}} {{{ $ ~/Software/ghc4/inplace/bin/ghc-stage2 Bug.hs [1 of 1] Compiling Bug ( Bug.hs, Bug.o ) ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.7.20190219 for x86_64-unknown-linux): piResultTys1 k_a10k[tau:1] [*] Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler/utils/Outputable.hs:1159:37 in ghc:Outputable pprPanic, called at compiler/types/Type.hs:1063:5 in ghc:Type }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16347#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16347: GHC HEAD regression: piResultTys1 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: Component: Compiler (Type | Version: 8.7 checker) | Resolution: | Keywords: TypeInType 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): * cc: simonpj (added) Comment: This regression was introduced in commit 682783828275cca5fd8bf5be5b52054c75e0e22c (`Make a smart mkAppTyM`). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16347#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16347: GHC HEAD regression: piResultTys1 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: Component: Compiler (Type | Version: 8.7 checker) | Resolution: | Keywords: TypeInType 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 simonpj): Interestingly this is a consequence of the broken-ness described in #16344. Fixing the latter fixes this ticket too. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16347#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16347: GHC HEAD regression: piResultTys1 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: Component: Compiler (Type | Version: 8.7 checker) | Resolution: | Keywords: TypeInType 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 goldfire): In conversation, Simon and I uncovered an unstated invariant: the `tyVarKind` of occurrences of a bound tyvar must share the `tyVarKind` of the binding site. In this example, that is not the case, because the kind of the tyvar contains a metavariable; it is zonked at an occurrence but not at the binding site. The fix is easy: do an extra zonk in `kcLHsQTyVars_NonCusk`, but fixing #16344 will also make this problem melt away. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16347#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16347: GHC HEAD regression: piResultTys1
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: new
Priority: highest | Milestone:
Component: Compiler (Type | Version: 8.7
checker) |
Resolution: | Keywords: TypeInType
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 Marge Bot
participants (1)
-
GHC