
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 = $dHasRep_aD1T `cast` ((HasRep (Vec <'Z>_N (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 $dHasRepZLVeczqZZZLKeyhZRZR_Ii5CR Here, `Key` is a type family from `Data.Key` in the keys package, and `Vec` is a GADT of statically length-indexed lists. Suggestions? Thanks, - Conal