No union subtype reduction during type inference (#37327)

* No union type subtype reduction in getImplicitIndexTypeOfType

* Add regression test
This commit is contained in:
Anders Hejlsberg
2020-03-11 10:27:51 -07:00
committed by GitHub
parent 505e7fb5d9
commit b78ef30cb7
5 changed files with 255 additions and 1 deletions

View File

@@ -10465,7 +10465,7 @@ namespace ts {
append(propTypes, getIndexTypeOfType(type, IndexKind.Number));
}
if (propTypes.length) {
return getUnionType(propTypes, UnionReduction.Subtype);
return getUnionType(propTypes);
}
}
return undefined;