forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow duplicate identifiers as long as their declarations span multip…
…le blocks Fixes microsoft#8675
- Loading branch information
1 parent
27292e4
commit 675d176
Showing
64 changed files
with
731 additions
and
487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 9 additions & 15 deletions
24
tests/baselines/reference/classAndInterfaceMergeConflictingMembers.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,38 @@ | ||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(2,12): error TS2300: Duplicate identifier 'x'. | ||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(6,5): error TS2300: Duplicate identifier 'x'. | ||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(10,15): error TS2300: Duplicate identifier 'x'. | ||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(14,5): error TS2300: Duplicate identifier 'x'. | ||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(18,13): error TS2300: Duplicate identifier 'x'. | ||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(22,5): error TS2300: Duplicate identifier 'x'. | ||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(10,15): error TS2686: All declarations of 'x' must have identical modifiers. | ||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(14,5): error TS2686: All declarations of 'x' must have identical modifiers. | ||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(18,13): error TS2686: All declarations of 'x' must have identical modifiers. | ||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(22,5): error TS2686: All declarations of 'x' must have identical modifiers. | ||
|
||
|
||
==== tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts (6 errors) ==== | ||
==== tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts (4 errors) ==== | ||
declare class C1 { | ||
public x : number; | ||
~ | ||
!!! error TS2300: Duplicate identifier 'x'. | ||
} | ||
|
||
interface C1 { | ||
x : number; | ||
~ | ||
!!! error TS2300: Duplicate identifier 'x'. | ||
} | ||
|
||
declare class C2 { | ||
protected x : number; | ||
~ | ||
!!! error TS2300: Duplicate identifier 'x'. | ||
!!! error TS2686: All declarations of 'x' must have identical modifiers. | ||
} | ||
|
||
interface C2 { | ||
x : number; | ||
~ | ||
!!! error TS2300: Duplicate identifier 'x'. | ||
!!! error TS2686: All declarations of 'x' must have identical modifiers. | ||
} | ||
|
||
declare class C3 { | ||
private x : number; | ||
~ | ||
!!! error TS2300: Duplicate identifier 'x'. | ||
!!! error TS2686: All declarations of 'x' must have identical modifiers. | ||
} | ||
|
||
interface C3 { | ||
x : number; | ||
~ | ||
!!! error TS2300: Duplicate identifier 'x'. | ||
!!! error TS2686: All declarations of 'x' must have identical modifiers. | ||
} |
27 changes: 0 additions & 27 deletions
27
tests/baselines/reference/classAndInterfaceWithSameName.errors.txt
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
tests/baselines/reference/classAndInterfaceWithSameName.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
=== tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts === | ||
class C { foo: string; } | ||
>C : Symbol(C, Decl(classAndInterfaceWithSameName.ts, 0, 0), Decl(classAndInterfaceWithSameName.ts, 0, 24)) | ||
>foo : Symbol(C.foo, Decl(classAndInterfaceWithSameName.ts, 0, 9), Decl(classAndInterfaceWithSameName.ts, 1, 13)) | ||
|
||
interface C { foo: string; } | ||
>C : Symbol(C, Decl(classAndInterfaceWithSameName.ts, 0, 0), Decl(classAndInterfaceWithSameName.ts, 0, 24)) | ||
>foo : Symbol(C.foo, Decl(classAndInterfaceWithSameName.ts, 0, 9), Decl(classAndInterfaceWithSameName.ts, 1, 13)) | ||
|
||
module M { | ||
>M : Symbol(M, Decl(classAndInterfaceWithSameName.ts, 1, 28)) | ||
|
||
class D { | ||
>D : Symbol(D, Decl(classAndInterfaceWithSameName.ts, 3, 10), Decl(classAndInterfaceWithSameName.ts, 6, 5)) | ||
|
||
bar: string; | ||
>bar : Symbol(D.bar, Decl(classAndInterfaceWithSameName.ts, 4, 13), Decl(classAndInterfaceWithSameName.ts, 8, 17)) | ||
} | ||
|
||
interface D { | ||
>D : Symbol(D, Decl(classAndInterfaceWithSameName.ts, 3, 10), Decl(classAndInterfaceWithSameName.ts, 6, 5)) | ||
|
||
bar: string; | ||
>bar : Symbol(D.bar, Decl(classAndInterfaceWithSameName.ts, 4, 13), Decl(classAndInterfaceWithSameName.ts, 8, 17)) | ||
} | ||
} |
Oops, something went wrong.