[Git][ghc/ghc][wip/T25647] rename isWildCardMetaTyVar to isNoDefTauMetaTyVar and fix defaultTyVarTcS
Patrick (@soulomoon)
gitlab at gitlab.haskell.org
Sun Feb 9 09:45:45 UTC 2025
Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC
Commits:
1273d9a7 by Patrick at 2025-02-09T17:45:36+08:00
rename isWildCardMetaTyVar to isNoDefTauMetaTyVar and fix defaultTyVarTcS
- - - - -
3 changed files:
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/TcType.hs
Changes:
=====================================
compiler/GHC/Tc/Solver/Default.hs
=====================================
@@ -176,6 +176,8 @@ defaultTyVarTcS the_tv
-- TyVarTvs should only be unified with a tyvar
-- never with a type; c.f. GHC.Tc.Utils.TcMType.defaultTyVar
-- and Note [Inferring kinds for type declarations] in GHC.Tc.TyCl
+ || isNoDefTauMetaTyVar the_tv
+ -- do not default NoDefTauTvs see Note [NoDefTauTv]
= return noUnification
| isRuntimeRepVar the_tv
= do { traceTcS "defaultTyVarTcS RuntimeRep" (ppr the_tv)
=====================================
compiler/GHC/Tc/Utils/TcMType.hs
=====================================
@@ -1866,7 +1866,7 @@ defaultTyVar :: DefaultingStrategy
-> TcM Bool -- True <=> defaulted away altogether
defaultTyVar def_strat tv
| not (isMetaTyVar tv )
- || isWildCardMetaTyVar tv
+ || isNoDefTauMetaTyVar tv
-- do not default NoDefTauTvs see Note [NoDefTauTv]
|| isTyVarTyVar tv
-- Do not default TyVarTvs. Doing so would violate the invariants
=====================================
compiler/GHC/Tc/Utils/TcType.hs
=====================================
@@ -51,7 +51,7 @@ module GHC.Tc.Utils.TcType (
TcTyVarDetails(..), pprTcTyVarDetails, vanillaSkolemTvUnk,
MetaDetails(Flexi, Indirect), MetaInfo(..), skolemSkolInfo,
isImmutableTyVar, isSkolemTyVar, isMetaTyVar, isMetaTyVarTy, isTyVarTy,
- isWildCardMetaTyVar, tcIsTcTyVar, isTyVarTyVar, isOverlappableTyVar,
+ isNoDefTauMetaTyVar, tcIsTcTyVar, isTyVarTyVar, isOverlappableTyVar,
isTyConableTyVar,
ConcreteTvOrigin(..), isConcreteTyVar_maybe, isConcreteTyVar,
isConcreteTyVarTy, isConcreteTyVarTy_maybe, concreteInfo_maybe,
@@ -1183,7 +1183,7 @@ isImmutableTyVar :: TyVar -> Bool
isImmutableTyVar tv = isSkolemTyVar tv
isTyConableTyVar, isSkolemTyVar, isOverlappableTyVar,
- isMetaTyVar, isAmbiguousTyVar, isCycleBreakerTyVar, isWildCardMetaTyVar :: TcTyVar -> Bool
+ isMetaTyVar, isAmbiguousTyVar, isCycleBreakerTyVar, isNoDefTauMetaTyVar :: TcTyVar -> Bool
isTyConableTyVar tv
-- True of a meta-type variable that can be filled in
@@ -1224,7 +1224,7 @@ isMetaTyVar tv
_ -> False
| otherwise = False
-isWildCardMetaTyVar tv
+isNoDefTauMetaTyVar tv
| isTyVar tv -- See Note [Coercion variables in free variable lists]
= case tcTyVarDetails tv of
MetaTv { mtv_info = NoDefTauTv } -> True
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1273d9a7dfbd906c800f48409c1c085bea8ed8e9
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1273d9a7dfbd906c800f48409c1c085bea8ed8e9
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20250209/1ba7875e/attachment-0001.html>
More information about the ghc-commits
mailing list