[GHC] #13343: Levity polymorphism-related GHC panic: expectJust zonkTcTyVarToVar

#13343: Levity polymorphism-related GHC panic: expectJust zonkTcTyVarToVar -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 (Type checker) | Keywords: | Operating System: Unknown/Multiple LevityPolymorphism | Architecture: | Type of failure: Compile-time Unknown/Multiple | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Reproducible with GHC 8.0.2 and HEAD: {{{#!hs {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeInType #-} module Bug where import GHC.Exts type Bad = forall (v1 :: RuntimeRep) (a1 :: TYPE v). a1 }}} {{{ [1 of 1] Compiling Bug ( Bug.hs, Bug.o ) ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.1.20170223 for x86_64-unknown-linux): expectJust zonkTcTyVarToVar CallStack (from HasCallStack): error, called at compiler/utils/Maybes.hs:53:27 in ghc:Maybes expectJust, called at compiler/typecheck/TcType.hs:1576:21 in ghc:TcType }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13343 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13343: Levity polymorphism-related GHC panic: expectJust zonkTcTyVarToVar -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: Resolution: | LevityPolymorphism 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): I don't have more time to look into precisely why this is getting through the cracks, but that type should be rejected by `TcValidity.check_type`. Look for the call to `forAllEscapeErr`. In short, that type is malformed because it's kind must mention `v`, which is out-of-scope. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13343#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13343: Levity polymorphism-related GHC panic: expectJust zonkTcTyVarToVar -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: Resolution: | LevityPolymorphism 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 simonpj): * owner: (none) => goldfire Comment: See comment:10 of #11827 for another example. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13343#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13343: Levity polymorphism-related GHC panic: expectJust zonkTcTyVarToVar
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: goldfire
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 8.0.1
checker) | Keywords:
Resolution: | LevityPolymorphism
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 Richard Eisenberg

#13343: Levity polymorphism-related GHC panic: expectJust zonkTcTyVarToVar -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: goldfire Type: bug | Status: merge Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: Resolution: | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | typecheck/should_compile/T13343 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => merge * testcase: => typecheck/should_compile/T13343 * milestone: => 8.2.1 Comment: My comment:1 gets it all wrong, but it was simple in the end. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13343#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13343: Levity polymorphism-related GHC panic: expectJust zonkTcTyVarToVar -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: goldfire Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: Resolution: fixed | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | typecheck/should_compile/T13343 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.2` as 32c9abee8304d1ab86329bb24652b7232669def2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13343#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC