[GHC] #14880: GHC panic: updateRole

GHC ghc-devs at haskell.org
Mon Sep 24 08:25:22 UTC 2018


#14880: GHC panic: updateRole
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  goldfire
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler (Type    |              Version:  8.2.2
  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:  #15076            |  Differential Rev(s):  Phab:D4769,
       Wiki Page:                    |  Phab:D5141, Phab:D5147, Phab:D5150
-------------------------------------+-------------------------------------

Comment (by tdammers):

 The first test to fail is `T14880-2`, a new test based on the reproduction
 case in comment:2. GHC 8.4 fails with a panic; the GHC version in
 `wip/T14880-2-step3` compiles it without errors when compiling core lint
 disabled, but enabling core lint (as in the test suite) triggers a lint
 failure:

 {{{
 =====> T14880-2(normal) 1 of 1 [0, 0, 0]
 cd "dependent/should_compile/T14880-2.run" &&  "/home/tobias/well-
 typed/devel/ghc-phab/inplace/test   spaces/ghc-stage2" -c T14880-2.hs
 -dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-
 specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-
 diagnostics-show-caret -dno-debug-output
 Compile failed (exit code 1) errors were:
 *** Core Lint errors : in result of Desugar (before optimization) ***
 <no location info>: warning:
     In the type ‘Proxy (Foo arg_a1eO)’
     Kind application error in type ‘Proxy a_a1eN’
       Function kind = forall k. k -> *
       Arg kinds = [(arg_a1eO, *), (a_a1eN, arg_a1eM)]
     Fun: arg_a1eO
          (a_a1eN, arg_a1eM)
 <no location info>: warning:
     In the type ‘Proxy (Foo arg_a1eO)’
     Kind application error in type ‘Foo arg_a1eO’
       Function kind = forall x -> forall (a :: x). Proxy a -> *
       Arg kinds = [(arg_a1eO, *), (a_a1eN, arg_a1eM)]
     Forall: a_aZA
             arg_a1eO
             (a_a1eN, arg_a1eM)
 *** Offending Program ***
 Rec {
 $tcFoo :: TyCon
 [LclIdX]
 $tcFoo
   = TyCon
       1426396007728932770##
       937350176756910988##
       $trModule
       (TrNameS "Foo"#)
       2#
       $krep_a1qj

 $krep_a1qm [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId]
 $krep_a1qm = $WKindRepVar (I# 1#)

 $krep_a1ql [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId]
 $krep_a1ql = $WKindRepVar (I# 0#)

 $krep_a1qj [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId]
 $krep_a1qj = KindRepFun $krep_a1qk krep$*

 $krep_a1qk [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId]
 $krep_a1qk
   = KindRepTyConApp
       $tcProxy
       (: @ KindRep $krep_a1ql (: @ KindRep $krep_a1qm ([] @ KindRep)))

 $trModule :: Module
 [LclIdX]
 $trModule = Module (TrNameS "main"#) (TrNameS "Bug"#)

 quux :: forall arg (a :: arg) arg. Proxy (Foo arg) -> ()
 [LclIdX]
 quux
   = \ (@ arg_a1eM)
       (@ (a_a1eN :: arg_a1eM))
       (@ arg_a1eO)
       (ds_d1qn :: Proxy (Foo arg_a1eO)) ->
       ()
 end Rec }

 *** End of Offense ***
 }}}

 I can't tell whether this means that the Core is indeed incorrect, or that
 the core linter is wrong in rejecting this program.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14880#comment:140>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list