Skip to content

Panic! from ImplicitParams and Arrows

Summary

The Code

{-# LANGUAGE ImplicitParams
             , Arrows #-}

import Control.Arrow

test :: (Eq a, Num a) => a -> a
test = proc a -> do
  let ?ldfk = undefined
  4 <- returnA -< a
  returnA -< a


main = print $ test 4

produces the error

<no location info>: error:
    panic! (the 'impossible' happened)
  GHC version 9.8.2:
	lookupIdSubst
  $dNum_a11h
  InScope {ds_X0 a_aZE $dEq_aZF $dNum_aZG ds_d13D ds_d13E ds_d13O
           ds_d13P ds_d13S}
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/GHC/Utils/Panic.hs:191:37 in ghc-9.8.2-32bd:GHC.Utils.Panic
        pprPanic, called at compiler/GHC/Core/Subst.hs:197:17 in ghc-9.8.2-32bd:GHC.Core.Subst
  CallStack (from HasCallStack):
    panic, called at compiler/GHC/Utils/Error.hs:503:29 in ghc-9.8.2-32bd:GHC.Utils.Error

Steps to reproduce

compile that code

Expected behavior

give a better error or dont panic

Environment

  • GHC version used: 9.8.2
Edited by Jkensik
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information