Simon Peyton Jones pushed to branch wip/T26115 at Glasgow Haskell Compiler / GHC
Commits:
-
e5017601
by Simon Peyton Jones at 2025-06-21T22:56:35+01:00
3 changed files:
Changes:
... | ... | @@ -767,6 +767,7 @@ tryShortCutSolver try_short_cut dict_w@(DictCt { di_ev = ev_w }) |
767 | 767 | -- Enabled by the -fsolve-constant-dicts flag
|
768 | 768 | |
769 | 769 | -> tryTcS $ -- tryTcS tries to completely solve some contraints
|
770 | + setTcSMode TcSSpecPrag $
|
|
770 | 771 | do { updInertSet zap_cans
|
771 | 772 | ; solveSimpleWanteds (unitBag (CDictCan dict_w)) }
|
772 | 773 | |
... | ... | @@ -899,7 +900,7 @@ matchClassInst dflags inerts clas tys loc |
899 | 900 | ; return local_res }
|
900 | 901 | |
901 | 902 | NoInstance -- No local instances, so try global ones
|
902 | - -> do { global_res <- matchGlobalInst dflags False clas tys loc
|
|
903 | + -> do { global_res <- matchGlobalInst dflags clas tys loc
|
|
903 | 904 | ; warn_custom_warn_instance global_res loc
|
904 | 905 | -- See Note [Implementation of deprecated instances]
|
905 | 906 | ; traceTcS "} matchClassInst global result" $ ppr global_res
|
... | ... | @@ -2020,12 +2020,11 @@ instFlexiXTcM subst (tv:tvs) |
2020 | 2020 | subst' = extendTvSubstWithClone subst tv tv'
|
2021 | 2021 | ; instFlexiXTcM subst' tvs }
|
2022 | 2022 | |
2023 | -matchGlobalInst :: DynFlags
|
|
2024 | - -> Bool -- True <=> caller is the short-cut solver
|
|
2025 | - -- See Note [Shortcut solving: overlap]
|
|
2026 | - -> Class -> [Type] -> CtLoc -> TcS TcM.ClsInstResult
|
|
2027 | -matchGlobalInst dflags short_cut cls tys loc
|
|
2028 | - = wrapTcS $ TcM.matchGlobalInst dflags short_cut cls tys (Just loc)
|
|
2023 | +matchGlobalInst :: DynFlags -> Class -> [Type] -> CtLoc -> TcS TcM.ClsInstResult
|
|
2024 | +matchGlobalInst dflags cls tys loc
|
|
2025 | + = do { mode <- getTcSMode
|
|
2026 | + ; let short_cut = mode == TcSSpecPrag
|
|
2027 | + ; wrapTcS $ TcM.matchGlobalInst dflags short_cut cls tys (Just loc) }
|
|
2029 | 2028 | |
2030 | 2029 | tcInstSkolTyVarsX :: SkolemInfo -> Subst -> [TyVar] -> TcS (Subst, [TcTyVar])
|
2031 | 2030 | tcInstSkolTyVarsX skol_info subst tvs = wrapTcS $ TcM.tcInstSkolTyVarsX skol_info subst tvs
|
... | ... | @@ -26,13 +26,13 @@ import GHC.Data.Maybe |
26 | 26 | import GHC.Tc.Utils.Unify ( tcSubTypeAmbiguity )
|
27 | 27 | import GHC.Tc.Solver ( simplifyAmbiguityCheck )
|
28 | 28 | import GHC.Tc.Instance.Class ( matchGlobalInst, ClsInstResult(..), AssocInstInfo(..) )
|
29 | -import GHC.Tc.Utils.TcType
|
|
29 | +import GHC.Tc.Instance.FunDeps
|
|
30 | +import GHC.Tc.Instance.Family
|
|
30 | 31 | import GHC.Tc.Types.Origin
|
31 | 32 | import GHC.Tc.Types.Rank
|
32 | 33 | import GHC.Tc.Errors.Types
|
34 | +import GHC.Tc.Utils.TcType
|
|
33 | 35 | import GHC.Tc.Utils.Monad
|
34 | -import GHC.Tc.Instance.FunDeps
|
|
35 | -import GHC.Tc.Instance.Family
|
|
36 | 36 | import GHC.Tc.Zonk.TcType
|
37 | 37 | |
38 | 38 | import GHC.Builtin.Types
|