Enable CFA on this keyword unconditionally (#21490)

This commit is contained in:
Wesley Wigham
2018-02-02 00:30:03 -08:00
committed by GitHub
parent 06c5d393b5
commit 8b81d19b6d
5 changed files with 115 additions and 3 deletions

View File

@@ -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);
}
}
}