diff options
author | sheaf <sam.derbyshire@gmail.com> | 2023-05-11 13:08:14 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-05-12 06:10:57 -0400 |
commit | c176ad1835ccfe55e2bde875b4a35e9d226ff657 (patch) | |
tree | 585897cd4bdbb5babd5c86eaed88aa26a8a42595 /compiler/GHC/Core | |
parent | a856d98eb13401b78fa7eba9a54ea4c501ebb0a2 (diff) | |
download | haskell-c176ad1835ccfe55e2bde875b4a35e9d226ff657.tar.gz |
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
Diffstat (limited to 'compiler/GHC/Core')
-rw-r--r-- | compiler/GHC/Core/Type.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Core/Type.hs b/compiler/GHC/Core/Type.hs index 86f483abca..796fb5aecd 100644 --- a/compiler/GHC/Core/Type.hs +++ b/compiler/GHC/Core/Type.hs @@ -1505,7 +1505,7 @@ piResultTys ty orig_args@(arg:args) -- c.f. #15473 pprPanic "piResultTys2" (ppr ty $$ ppr orig_args $$ ppr all_args) -applyTysX :: [TyVar] -> Type -> [Type] -> Type +applyTysX :: HasDebugCallStack => [TyVar] -> Type -> [Type] -> Type -- applyTysX beta-reduces (/\tvs. body_ty) arg_tys -- Assumes that (/\tvs. body_ty) is closed applyTysX tvs body_ty arg_tys |