"opt_univ fell into a hole"

Simon Peyton Jones simonpj at microsoft.com
Mon Apr 4 09:48:25 UTC 2016

Definitely a bug. All HoleProvs should be eliminated by the type checker.

Did your plugin produce a HoleProv?  It definitely should not do so; see the notes with that constructor.

Lint checks for this – did you run with –dcore-lint?


From: ghc-devs [mailto:ghc-devs-bounces at haskell.org] On Behalf Of Conal Elliott
Sent: 02 April 2016 20:24
To: ghc-devs at haskell.org
Subject: "opt_univ fell into a hole"

I'm getting the following error message from a GHC plugin I'm developing (note GHC version):

    ghc-stage2: panic! (the 'impossible' happened)
      (GHC version 8.1.20160307 for x86_64-apple-darwin):
            opt_univ fell into a hole {aD1S}

I don't get this error when compiling without my plugin, so I may well be violating a compiler invariant.

Shortly before the error, the plugin produced the following dictionary expression, which does indeed contain a `UnivCo` with a `HoleProv`. The plugin does sometimes generate `UnivCo`s but not with `HoleProv`.

    let {
      $dHasRep_aD1T :: HasRep (Vec 'Z s_aD1R[fuv:0])
      $dHasRep_aD1T = $fHasRepVec0 @ s_aD1R[fuv:0] } in
    let {
      $dHasRepZLVeczqZZZLKeyhZRZR_Ii5CR :: HasRep (Vec 'Z (Key h_aCnh))
      $dHasRepZLVeczqZZZLKeyhZRZR_Ii5CR =
        `cast` ((HasRep
                      (Sym U(hole:{aD1S}, Key h_aCnh, s_aD1R[fuv:0])_N))_N)_R
                :: HasRep (Vec 'Z s_aD1R[fuv:0])
                   ~R# HasRep (Vec 'Z (Key h_aCnh))) } in

Here, `Key` is a type family from `Data.Key` in the keys package, and `Vec` is a GADT of statically length-indexed lists.


Thanks, - Conal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160404/dca082e7/attachment.html>

More information about the ghc-devs mailing list