Skip to content

Don't panic in mkNewTyConRhs

sheaf requested to merge sheaf/ghc:T23308 into master

This function could come across invalid newtype constructors, as we only perform validity checking of newtypes once we are outside the knot-tied typechecking loop. This patch changes this function to fake up a stub type in the case of an invalid newtype, instead of panicking.

This patch also changes checkNewDataCon so that it reports as many errors as possible at once.

Merge request reports