Merge pull request #28695 from weswigham/overlappy-count-unit-only

Count only unit types when counting overlapping keys
This commit is contained in:
Daniel Rosenwasser
2018-11-30 15:43:32 -08:00
committed by GitHub
5 changed files with 9 additions and 9 deletions

View File

@@ -11980,7 +11980,7 @@ namespace ts {
// Some subset overlap if we have only string literals.
// If we have a union of index types, it seems likely that we
// needed to elaborate between two generic mapped types anyway.
const len = length((overlap as UnionType).types);
const len = length(filter((overlap as UnionType).types, isUnitType));
if (len >= matchingCount) {
bestMatch = target;
matchingCount = len;