Count only unit types when counting overlapping keys

This commit is contained in:
Wesley Wigham
2018-11-27 16:17:57 -08:00
parent aa3734c148
commit e594407103
5 changed files with 9 additions and 9 deletions

View File

@@ -11975,7 +11975,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;