Don't panic in mkNewTyConRhs
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. Fixes #23308
Showing
- compiler/GHC/Core/Type.hs 1 addition, 1 deletioncompiler/GHC/Core/Type.hs
- compiler/GHC/Tc/TyCl.hs 28 additions, 19 deletionscompiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Build.hs 14 additions, 6 deletionscompiler/GHC/Tc/TyCl/Build.hs
- testsuite/tests/typecheck/should_fail/T23308.hs 39 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T23308.hs
- testsuite/tests/typecheck/should_fail/T23308.stderr 50 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T23308.stderr
- testsuite/tests/typecheck/should_fail/all.T 1 addition, 0 deletionstestsuite/tests/typecheck/should_fail/all.T
Loading
Please register or sign in to comment