[GHC] #15370: Typed hole panic on GHC 8.6 (tcTyVarDetails)

GHC ghc-devs at haskell.org
Sat Jul 21 08:37:21 UTC 2018


#15370: Typed hole panic on GHC 8.6 (tcTyVarDetails)
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  Tritlo
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.4.3
  checker)                           |             Keywords:  TypeInType,
      Resolution:                    |  TypedHoles
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 Tritlo):

 After some investigation, here is some more info:

 I'm running this on the branch on which I've fixed #15384, and now it
 generates a different panic:

 {{{
         Filling a filled coercion hole
   co_a1we
   Sym (S <x_a1vL[sk:1]>_N
          <x_a1vL[sk:1]>_N
          (Sym (GRefl nominal r_a1vN[sk:1]
                    (Sym (Either
                            <x_a1vL[sk:1]>_N (Sym co_a1vU))_N)) ; GRefl
 nominal r_a1vN[sk:1]
                                                                      (Sym
 (Either
 <x_a1vL[sk:1]>_N
 (Sym co_a1vU))_N)))_N ; {co_a1ws}
   Sym (S <x_a1vL[sk:1]>_N
          <x_a1vL[sk:1]>_N
          (Sym (GRefl nominal r_a1vN[sk:1]
                    (Sym (Either
                            <x_a1vL[sk:1]>_N (Sym co_a1vU))_N)) ; GRefl
 nominal r_a1vN[sk:1]
                                                                      (Sym
 (Either
 <x_a1vL[sk:1]>_N
 (Sym co_a1vU))_N)))_N ; {co_a1wm}
 }}}

 This happens when trying to simplify:

 {{{
 WC {wc_impl =
       Implic {
         TcLevel = 1
         Skolems = x_a1vL[sk:1]
                   y_a1vM[sk:1]
                   (r_a1vN[sk:1] :: Either x_a1vL[sk:1] y_a1vM[sk:1])
         No-eqs = True
         Status = Insoluble
         Given =
         Wanted =
           WC {wc_impl =
                 Implic {
                   TcLevel = 2
                   Skolems =
                   No-eqs = False
                   Status = Insoluble
                   Given = co_a1vU :: y_a1vM[sk:1] GHC.Prim.~# x_a1vL[sk:1]
                   Wanted =
                     WC {wc_simple =
                           [WD] hole{co_a1wo} {0}:: (S r_a1vN[sk:1] -> ())
                                                    GHC.Prim.~# S
 (r_a1vN[sk:1] |> Sym (Either
 <x_a1vL[sk:1]>_N
 (Sym co_a1vU))_N) (CNonCanonical)
                           [WD] hole{co_a1we} {1}:: S (r_a1vN[sk:1] |> Sym
 (Either
 <x_a1vL[sk:1]>_N
 (Sym co_a1vU))_N)
                                                    GHC.Prim.~# ()
 (CNonCanonical)
                           [WD] $dNum_a1wf {0}:: Num
                                                   (S (r_a1vN[sk:1] |> Sym
 (Either
 <x_a1vL[sk:1]>_N
 (Sym co_a1vU))_N)) (CNonCanonical)}
                   Binds = EvBindsVar<a1wp>
                   a pattern with constructor: Refl :: forall k (a :: k). a
 :~: a,
                   in a case alternative }}
 }}}

 where

 {{{
 WC {wc_simple =
     [WD] hole{co_a1wi} {0}:: y_a1vM[sk:1]
                                 GHC.Prim.~# x_a1vL[sk:1] (CNonCanonical)}
 }}}

 is generated by `tcSubType_NC`.

 I'm not sure how to prevent/catch the filling of the unfilled coercion
 hole and discard those fits.

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


More information about the ghc-tickets mailing list