Unwrap substitutions on conditional check types before comparing them (#43888)

This commit is contained in:
Wesley Wigham authored and GitHub committed 2021-05-05 13:33:45 -07:00
1 parent 84da19efc8
commit b83148fe64
5 files changed
+33 -1

No files matched your search

+1 -1
View File
@@ -15022,7 +15022,7 @@ namespace ts {
// purposes of resolution. This means such types aren't subject to the instatiation depth limiter.
while (true) {
const isUnwrapped = isTypicalNondistributiveConditional(root);
const checkType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.checkType), mapper);
const checkType = instantiateType(unwrapNondistributiveConditionalTuple(root, getActualTypeVariable(root.checkType)), mapper);
const checkTypeInstantiable = isGenericObjectType(checkType) || isGenericIndexType(checkType);
const extendsType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), mapper);
if (checkType === wildcardType || extendsType === wildcardType) {