Remove bug-causing carve-out in conditional type instantiation that hopefully is no longer required (#51151)

This commit is contained in:
Wesley Wigham
2022-10-13 10:58:42 -07:00
committed by GitHub
parent 37317a208f
commit bdcc240d68
5 changed files with 246 additions and 5 deletions

View File

@@ -16372,11 +16372,7 @@ namespace ts {
}
}
}
// We skip inference of the possible `infer` types unles the `extendsType` _is_ an infer type
// if it was, it's trivial to say that extendsType = checkType, however such a pattern is used to
// "reset" the type being build up during constraint calculation and avoid making an apparently "infinite" constraint
// so in those cases we refain from performing inference and retain the uninfered type parameter
if (!checkTypeInstantiable || !some(root.inferTypeParameters, t => t === extendsType)) {
if (!checkTypeInstantiable) {
// We don't want inferences from constraints as they may cause us to eagerly resolve the
// conditional type instead of deferring resolution. Also, we always want strict function
// types rules (i.e. proper contravariance) for inferences.