Skip to content

Commit a816162

Browse files
authored
Remove unneeded Array and Promise JS rewrites (#35482)
Type-argument defaulting is handled elsewhere in the compiler. This is a small drive-by improvement, so I didn't change the handling of 'array' or 'promise'; they still manually create `any[]` and `Promise<any>`, respectively.
1 parent 7e572b6 commit a816162

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/compiler/checker.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10921,10 +10921,8 @@ namespace ts {
1092110921
case "function":
1092210922
checkNoTypeArguments(node);
1092310923
return globalFunctionType;
10924-
case "Array":
1092510924
case "array":
1092610925
return (!typeArgs || !typeArgs.length) && !noImplicitAny ? anyArrayType : undefined;
10927-
case "Promise":
1092810926
case "promise":
1092910927
return (!typeArgs || !typeArgs.length) && !noImplicitAny ? createPromiseType(anyType) : undefined;
1093010928
case "Object":

0 commit comments

Comments
 (0)