Skip to content

Commit a55d6fb

Browse files
committed
Actually change fallback to candidate type otherwise any narrowing breaks
1 parent e826824 commit a55d6fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15268,7 +15268,7 @@ namespace ts {
1526815268
case "object":
1526915269
return type.flags & TypeFlags.Unknown ? getUnionType([nonPrimitiveType, nullType]) : type;
1527015270
default:
15271-
return typeofTypesByName.get(text) || unknownType;
15271+
return typeofTypesByName.get(text) || type;
1527215272
}
1527315273
};
1527415274
if (!(hasDefaultClause || (type.flags & TypeFlags.Union))) {

0 commit comments

Comments
 (0)