Reuse stored types for any[] and Promise<any> instead of creating new ones (#17179)

* Reuse stored types for any[] and Promise<any> instead of creating new ones

* Don't store anyPromiseType
This commit is contained in:
Andy 2017-07-17 12:56:58 -07:00 committed by GitHub
parent 2a219af308
commit 5d46ca7118

View File

@ -6892,7 +6892,7 @@ namespace ts {
return globalFunctionType;
case "Array":
case "array":
return !node.typeArguments || !node.typeArguments.length ? createArrayType(anyType) : undefined;
return !node.typeArguments || !node.typeArguments.length ? anyArrayType : undefined;
case "Promise":
case "promise":
return !node.typeArguments || !node.typeArguments.length ? createPromiseType(anyType) : undefined;