mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Enable CFA on this keyword unconditionally (#21490)
This commit is contained in:
1 parent
06c5d393b5
commit
8b81d19b6d
5 files changed
+115
-3
No files matched your search
@@ -13341,13 +13341,13 @@ namespace ts {
|
||||
.expression; // x
|
||||
const classSymbol = checkExpression(className).symbol;
|
||||
if (classSymbol && classSymbol.members && (classSymbol.flags & SymbolFlags.Function)) {
|
||||
return getInferredClassType(classSymbol);
|
||||
return getFlowTypeOfReference(node, getInferredClassType(classSymbol));
|
||||
}
|
||||
}
|
||||
|
||||
const thisType = getThisTypeOfDeclaration(container) || getContextualThisParameterType(container);
|
||||
if (thisType) {
|
||||
return thisType;
|
||||
return getFlowTypeOfReference(node, thisType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13360,7 +13360,7 @@ namespace ts {
|
||||
if (isInJavaScriptFile(node)) {
|
||||
const type = getTypeForThisExpressionFromJSDoc(container);
|
||||
if (type && type !== unknownType) {
|
||||
return type;
|
||||
return getFlowTypeOfReference(node, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user