repond to feedback

This commit is contained in:
Arthur Ozga
2017-06-01 16:03:11 -07:00
parent c1d466a716
commit 2fb9ab798c
3 changed files with 2 additions and 3 deletions

View File

@@ -110,7 +110,6 @@ namespace ts {
getParameterType: getTypeAtPosition,
getReturnTypeOfSignature,
getNonNullableType,
getBaseTypeVariableOfClass,
typeToTypeNode: nodeBuilder.typeToTypeNode,
indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration,
signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration,

View File

@@ -2530,7 +2530,6 @@ namespace ts {
*/
/* @internal */ getParameterType(signature: Signature, parameterIndex: number): Type;
getNonNullableType(type: Type): Type;
/* @internal */ getBaseTypeVariableOfClass(symbol: Symbol): Type | undefined;
/** Note that the resulting nodes cannot be checked. */
typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeNode;

View File

@@ -49,7 +49,8 @@ namespace ts.codefix {
const symbol = leftExpressionType.symbol;
if (symbol.flags & SymbolFlags.Class) {
classDeclaration = symbol.declarations && <ClassLikeDeclaration>symbol.declarations[0];
if (getObjectFlags(leftExpressionType) & ObjectFlags.Anonymous && symbol.flags & SymbolFlags.Class && !checker.getBaseTypeVariableOfClass(symbol)) {
if (leftExpressionType !== checker.getDeclaredTypeOfSymbol(symbol)) {
// The expression is a class symbol but the type is not the instance-side.
makeStatic = true;
}
}