diff options
Diffstat (limited to 'compiler/GHC/Tc/Utils/Backpack.hs')
-rw-r--r-- | compiler/GHC/Tc/Utils/Backpack.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/GHC/Tc/Utils/Backpack.hs b/compiler/GHC/Tc/Utils/Backpack.hs index 837ab3d2a7..4af4aae1e1 100644 --- a/compiler/GHC/Tc/Utils/Backpack.hs +++ b/compiler/GHC/Tc/Utils/Backpack.hs @@ -132,6 +132,7 @@ checkHsigIface tcg_env gr sig_iface traceTc "checkHsigIface" $ vcat [ ppr sig_type_env, ppr sig_insts, ppr sig_exports ] mapM_ check_export (map availName sig_exports) + failIfErrsM -- See Note [Fail before checking instances in checkHsigIface] unless (null sig_fam_insts) $ panic ("GHC.Tc.Module.checkHsigIface: Cannot handle family " ++ "instances in hsig files yet...") @@ -192,6 +193,14 @@ checkHsigIface tcg_env gr sig_iface addErrAt (nameSrcSpan name) (missingBootThing False name "exported by") +-- Note [Fail before checking instances in checkHsigIface] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- We need to be careful about failing before checking instances if there happens +-- to be an error in the exports. +-- Otherwise, we might proceed with typechecking (and subsequently panic-ing) on +-- ill-kinded types that are constructed while checking instances. +-- This lead to #19244 + -- Note [Error reporting bad reexport] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- NB: You want to be a bit careful about what location you report on reexports. |