diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9de448f4236..e90e40967d3 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -83,13 +83,10 @@ namespace ts { getSignaturesOfType, getIndexTypeOfType, getBaseTypes, - getUnionType, - getIntersectionType, - getTypeFromTypeReference, + getTypeFromTypeNode, getReturnTypeOfSignature, getNonNullableType, getSymbolsInScope, - createSymbol, getSymbolAtLocation, getShorthandAssignmentValueSymbol, getExportSpecifierLocalTargetSymbol, @@ -19743,9 +19740,6 @@ namespace ts { // This is a declaration, call getSymbolOfNode return getSymbolOfNode(node.parent); } - else if (node.kind === SyntaxKind.ClassKeyword && node.parent.kind === SyntaxKind.ClassExpression) { - return getSymbolOfNode(node.parent); - } else if (isLiteralComputedPropertyDeclarationName(node)) { return getSymbolOfNode(node.parent.parent); } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index a6f40041f3c..a9faae5004e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3203,10 +3203,6 @@ "category": "Message", "code": 90004 }, - "Implement interface on reference": { - "category": "Message", - "code": 90005 - }, "Implement interface '{0}'.": { "category": "Message", "code": 90006 diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 2a04916d45d..e035b4d3919 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2341,8 +2341,6 @@ namespace ts { getBaseTypes(type: InterfaceType): ObjectType[]; getReturnTypeOfSignature(signature: Signature): Type; getNonNullableType(type: Type): Type; - getIntersectionType(types: Type[], aliasSymbol?: Symbol, aliasTypeArguments?: Type[]): Type; - getUnionType(types: Type[], subtypeReduction?: boolean, aliasSymbol?: Symbol, aliasTypeArguments?: Type[]): Type; getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolAtLocation(node: Node): Symbol; @@ -2351,11 +2349,10 @@ namespace ts { getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol; getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol; getTypeAtLocation(node: Node): Type; - getTypeFromTypeReference(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference): Type; + getTypeFromTypeNode(node: TypeNode): Type; signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; - createSymbol(flags: SymbolFlags, name: string): Symbol; getSymbolDisplayBuilder(): SymbolDisplayBuilder; getFullyQualifiedName(symbol: Symbol): string; getAugmentedPropertiesOfType(type: Type): Symbol[]; diff --git a/src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts b/src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts index 915b23f050b..42488dc2aed 100644 --- a/src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts +++ b/src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts @@ -25,7 +25,7 @@ namespace ts.codefix { const result: CodeAction[] = []; for (const implementedTypeNode of implementedTypeNodes) { - const implementedType = checker.getTypeFromTypeReference(implementedTypeNode) as InterfaceType; + const implementedType = checker.getTypeFromTypeNode(implementedTypeNode) as InterfaceType; // Note that this is ultimately derived from a map indexed by symbol names, // so duplicates cannot occur. const implementedTypeSymbols = checker.getPropertiesOfType(implementedType); diff --git a/src/services/codefixes/helpers.ts b/src/services/codefixes/helpers.ts index 9827ec14f3b..d539ef0d68b 100644 --- a/src/services/codefixes/helpers.ts +++ b/src/services/codefixes/helpers.ts @@ -87,7 +87,6 @@ namespace ts.codefix { } function createBodySignatureWithAnyTypes(signatures: Signature[], enclosingDeclaration: ClassLikeDeclaration, checker: TypeChecker): Signature { - const newSignatureDeclaration = createNode(SyntaxKind.CallSignature) as SignatureDeclaration; newSignatureDeclaration.parent = enclosingDeclaration; newSignatureDeclaration.name = signatures[0].getDeclaration().name; @@ -126,7 +125,8 @@ namespace ts.codefix { function createParameterDeclarationWithoutType(index: number, minArgCount: number, enclosingSignatureDeclaration: SignatureDeclaration): ParameterDeclaration { const newParameter = createNode(SyntaxKind.Parameter) as ParameterDeclaration; - newParameter.symbol = checker.createSymbol(SymbolFlags.FunctionScopedVariable, maxArgsParameterSymbolNames[index] || "rest"); + + newParameter.symbol = new SymbolConstructor(SymbolFlags.FunctionScopedVariable, maxArgsParameterSymbolNames[index] || "rest"); newParameter.symbol.valueDeclaration = newParameter; newParameter.symbol.declarations = [newParameter]; newParameter.parent = enclosingSignatureDeclaration; @@ -151,4 +151,6 @@ namespace ts.codefix { } return ""; } + + const SymbolConstructor = objectAllocator.getSymbolConstructor(); } \ No newline at end of file