{-# LANGUAGE ExistentialQuantification, ApplicativeDo #-}moduleBugwheredataTf=foralla.MkT(fa)runf::forallf.Functorf=>IO(Tf)runf=doreturn()MkTfa<-runfreturn$MkTfa
Bug.hs:11:18: error:ghc: panic! (the 'impossible' happened) (GHC version 8.6.3 for x86_64-unknown-linux): No skolem info: [a_a1nb[ssk:2]] Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable pprPanic, called at compiler/typecheck/TcErrors.hs:2891:5 in ghc:TcErrorsPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Edited
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
I think the root cause of this is that the applicative-do stuff just doesn't work well with existentials. See the paper. The desugaring in Fig 5 really only works if the binder of the patterns don't include existentials.
To me that says:
GHC should check for this and complain if necessary. Not crash!
Someone might like to think about whether it'd be possible to accommodate existentials.
Reopening since this results the following assertion failure with the devel2 compiler:
GHC version 9.3.20210628: ASSERT failed! 2 1 a_aEl[tau:1] a_aE7[ssk:2] Call stack: CallStack (from HasCallStack): massertPpr, called at compiler/GHC/Tc/Utils/TcMType.hs:1006:10 in ghc:GHC.Tc.Utils.TcMType
The assertion still fails here with !7105 (closed), I think Simon is right that the issue is that ApplicativeDo and existentials don't work well together.
Matthew Pickeringchanged title from Panic with ExistentialQuantification and ApplicativeDo to Assertion failure with ExistentialQuantification and ApplicativeDo
changed title from Panic with ExistentialQuantification and ApplicativeDo to Assertion failure with ExistentialQuantification and ApplicativeDo
This test exposes an ouright bug in GHC, which leads to an assertion error as above. It would be great if someone who cares about ApplicativeDo could add a test for existentials (which aren't supported) so we got a decent error message rather than bogus results.
When assertions are not on, the program compiles -- probably wrongly.
With my new constraint solver !10123 (merged) it generates a type error in a compiler with assertions off. Maybe that's better, I'm not sure. But the same assertion fails if assertions are on.