diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e0cecdcda09..f5ff6a8c7c7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2184,7 +2184,7 @@ namespace ts { function isEntityNameVisible(entityName: EntityNameOrEntityNameExpression, enclosingDeclaration: Node): SymbolVisibilityResult { // get symbol of the first identifier of the entityName let meaning: SymbolFlags; - if (entityName.parent.kind === SyntaxKind.TypeQuery || + if (entityName.parent.kind === SyntaxKind.TypeQuery || isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || entityName.parent.kind === SyntaxKind.ComputedPropertyName) { // Typeof value diff --git a/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt b/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt index 325db86d47d..b304d197ada 100644 --- a/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt +++ b/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/classWithDuplicateIdentifier.ts(3,5): error TS2300: Duplica tests/cases/compiler/classWithDuplicateIdentifier.ts(6,5): error TS2300: Duplicate identifier 'b'. tests/cases/compiler/classWithDuplicateIdentifier.ts(7,5): error TS2300: Duplicate identifier 'b'. tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2300: Duplicate identifier 'c'. -tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'c' must be of type 'number', but here has type 'string'. +tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2711: Subsequent property declarations must have the same type. Property 'c' must be of type 'number', but here has type 'string'. ==== tests/cases/compiler/classWithDuplicateIdentifier.ts (5 errors) ==== @@ -26,6 +26,6 @@ tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2403: Subseq ~ !!! error TS2300: Duplicate identifier 'c'. ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'c' must be of type 'number', but here has type 'string'. +!!! error TS2711: Subsequent property declarations must have the same type. Property 'c' must be of type 'number', but here has type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateClassElements.errors.txt b/tests/baselines/reference/duplicateClassElements.errors.txt index 7579190db71..73c6e8eb7a8 100644 --- a/tests/baselines/reference/duplicateClassElements.errors.txt +++ b/tests/baselines/reference/duplicateClassElements.errors.txt @@ -16,7 +16,7 @@ tests/cases/compiler/duplicateClassElements.ts(26,9): error TS2300: Duplicate id tests/cases/compiler/duplicateClassElements.ts(29,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(32,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2300: Duplicate identifier 'x2'. -tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2403: Subsequent variable declarations must have the same type. Variable 'x2' must be of type 'number', but here has type 'any'. +tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2711: Subsequent property declarations must have the same type. Property 'x2' must be of type 'number', but here has type 'any'. tests/cases/compiler/duplicateClassElements.ts(36,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(36,9): error TS2300: Duplicate identifier 'z2'. tests/cases/compiler/duplicateClassElements.ts(39,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -96,7 +96,7 @@ tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate i ~~ !!! error TS2300: Duplicate identifier 'x2'. ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x2' must be of type 'number', but here has type 'any'. +!!! error TS2711: Subsequent property declarations must have the same type. Property 'x2' must be of type 'number', but here has type 'any'. get z2() { ~~ diff --git a/tests/baselines/reference/gettersAndSettersErrors.errors.txt b/tests/baselines/reference/gettersAndSettersErrors.errors.txt index a3be786cb26..c58b263d047 100644 --- a/tests/baselines/reference/gettersAndSettersErrors.errors.txt +++ b/tests/baselines/reference/gettersAndSettersErrors.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/gettersAndSettersErrors.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSettersErrors.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2300: Duplicate identifier 'Foo'. -tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2403: Subsequent variable declarations must have the same type. Variable 'Foo' must be of type 'string', but here has type 'number'. +tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2711: Subsequent property declarations must have the same type. Property 'Foo' must be of type 'string', but here has type 'number'. tests/cases/compiler/gettersAndSettersErrors.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSettersErrors.ts(7,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSettersErrors.ts(11,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -23,7 +23,7 @@ tests/cases/compiler/gettersAndSettersErrors.ts(12,16): error TS2379: Getter and ~~~ !!! error TS2300: Duplicate identifier 'Foo'. ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Foo' must be of type 'string', but here has type 'number'. +!!! error TS2711: Subsequent property declarations must have the same type. Property 'Foo' must be of type 'string', but here has type 'number'. public get Goo(v:string):string {return null;} // error - getters must not have a parameter ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. diff --git a/tests/baselines/reference/interfaceDeclaration1.errors.txt b/tests/baselines/reference/interfaceDeclaration1.errors.txt index 95b3d90ca2c..0a5df54aab3 100644 --- a/tests/baselines/reference/interfaceDeclaration1.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration1.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/interfaceDeclaration1.ts(2,5): error TS2300: Duplicate iden tests/cases/compiler/interfaceDeclaration1.ts(3,5): error TS2300: Duplicate identifier 'item'. tests/cases/compiler/interfaceDeclaration1.ts(7,5): error TS2300: Duplicate identifier 'item'. tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2300: Duplicate identifier 'item'. -tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'item' must be of type 'any', but here has type 'number'. +tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2711: Subsequent property declarations must have the same type. Property 'item' must be of type 'any', but here has type 'number'. tests/cases/compiler/interfaceDeclaration1.ts(22,11): error TS2310: Type 'I5' recursively references itself as a base type. tests/cases/compiler/interfaceDeclaration1.ts(35,7): error TS2420: Class 'C1' incorrectly implements interface 'I3'. Property 'prototype' is missing in type 'C1'. @@ -29,7 +29,7 @@ tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i ~~~~ !!! error TS2300: Duplicate identifier 'item'. ~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'item' must be of type 'any', but here has type 'number'. +!!! error TS2711: Subsequent property declarations must have the same type. Property 'item' must be of type 'any', but here has type 'number'. } interface I3 { diff --git a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt index 437bf2d80f0..aa21d20ebf4 100644 --- a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'. -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(15,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'T', but here has type 'number'. -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(39,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'T', but here has type 'number'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(6,5): error TS2711: Subsequent property declarations must have the same type. Property 'x' must be of type 'string', but here has type 'number'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(15,9): error TS2711: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(39,9): error TS2711: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'. ==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts (3 errors) ==== @@ -11,7 +11,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli interface A { x: number; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'. +!!! error TS2711: Subsequent property declarations must have the same type. Property 'x' must be of type 'string', but here has type 'number'. } module M { @@ -22,7 +22,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli interface A { x: number; // error ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'T', but here has type 'number'. +!!! error TS2711: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'. } } @@ -48,6 +48,6 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli export interface A { x: number; // error ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'T', but here has type 'number'. +!!! error TS2711: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'. } } \ No newline at end of file diff --git a/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt b/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt index 102a6a07836..99b43122a07 100644 --- a/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt +++ b/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt @@ -3,7 +3,7 @@ tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericString tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(12,5): error TS2300: Duplicate identifier '1'. tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(16,5): error TS2300: Duplicate identifier '1'. tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(17,5): error TS2300: Duplicate identifier '1'. -tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(17,5): error TS2403: Subsequent variable declarations must have the same type. Variable '1.0' must be of type 'number', but here has type 'string'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(17,5): error TS2711: Subsequent property declarations must have the same type. Property '1.0' must be of type 'number', but here has type 'string'. tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(22,5): error TS2300: Duplicate identifier '0'. @@ -36,7 +36,7 @@ tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericString ~~~ !!! error TS2300: Duplicate identifier '1'. ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable '1.0' must be of type 'number', but here has type 'string'. +!!! error TS2711: Subsequent property declarations must have the same type. Property '1.0' must be of type 'number', but here has type 'string'. } var b = { diff --git a/tests/baselines/reference/reassignStaticProp.errors.txt b/tests/baselines/reference/reassignStaticProp.errors.txt index 7f67a6e7fc3..149f04b9995 100644 --- a/tests/baselines/reference/reassignStaticProp.errors.txt +++ b/tests/baselines/reference/reassignStaticProp.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/reassignStaticProp.ts(5,12): error TS2300: Duplicate identifier 'bar'. -tests/cases/compiler/reassignStaticProp.ts(5,12): error TS2403: Subsequent variable declarations must have the same type. Variable 'bar' must be of type 'number', but here has type 'string'. +tests/cases/compiler/reassignStaticProp.ts(5,12): error TS2711: Subsequent property declarations must have the same type. Property 'bar' must be of type 'number', but here has type 'string'. ==== tests/cases/compiler/reassignStaticProp.ts (2 errors) ==== @@ -11,7 +11,7 @@ tests/cases/compiler/reassignStaticProp.ts(5,12): error TS2403: Subsequent varia ~~~ !!! error TS2300: Duplicate identifier 'bar'. ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'bar' must be of type 'number', but here has type 'string'. +!!! error TS2711: Subsequent property declarations must have the same type. Property 'bar' must be of type 'number', but here has type 'string'. }