HEAD panics (typeOrConstraint) when building lens-5.2
GHC HEAD (using commit 11627c42) panics when building the lens-5.2
library on Hackage. Here is a minimized example:
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}
module Bug (pattern P) where
pattern P :: C a => a
pattern P <- (m -> True)
class C a where
m :: a -> Bool
$ ghc-9.5.20221124/bin/ghc Bug.hs -fforce-recomp
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
<no location info>: error:
panic! (the 'impossible' happened)
GHC version 9.5.20221124:
typeOrConstraint
a_aw0[sk:2] :: k_awr[tau:2]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler\GHC\Utils\Panic.hs:189:37 in ghc:GHC.Utils.Panic
pprPanic, called at compiler\GHC\Core\Type.hs:2631:14 in ghc:GHC.Core.Type
typeTypeOrConstraint, called at compiler\GHC\Core\TyCo\Rep.hs:829:20 in ghc:GHC.Core.TyCo.Rep
mkInvisFunTys, called at compiler\GHC\Tc\Utils\TcType.hs:1303:11 in ghc:GHC.Tc.Utils.TcType
mkPhiTy, called at compiler\GHC\Tc\Gen\Sig.hs:488:9 in ghc:GHC.Tc.Gen.Sig
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug