Only used cached undefined contextual type for requests with no flags (#52224)

This commit is contained in:
Anders Hejlsberg
2023-01-13 10:10:56 -08:00
committed by GitHub
parent d6de73b20a
commit 41e4139357
5 changed files with 165 additions and 1 deletions

View File

@@ -28842,7 +28842,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
const index = findContextualNode(node);
if (index >= 0) {
return contextualTypes[index];
const cached = contextualTypes[index];
if (cached || !contextFlags) return cached;
}
const { parent } = node;
switch (parent.kind) {