Skip to content

Fix #14628: Panic (No skolem Info) in GHCi

Roland Senn requested to merge RolandSenn/ghc:T14628 into master

This patch implements the sugggestion from Simon (PJ):

  • Make TcErrors.getSkolemInfo return a SkolemInfo rather than an Implication.
  • If getSkolemInfo gets RuntimeUnks, just return a new data constructor in SkolemInfo, called RuntimeUnkSkol.
  • In TcErrors.pprSkols print something sensible for a RuntimeUnkSkol.

The getSkolemInfo function paniced while formating suggestions to add type annotations (subfunction suggestAddSig) to a "Couldn't match type ‘x’ with ‘y’" error message. The getSkolemInfo function didn't find any Implication value and paniced. With this patch the getSkolemInfo function does no longer panic, if it finds RuntimeUnkSkols.

As the panic occured while processing an error message, we don't need to implement any new error message!

Merge request reports