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.
Fixes microsoft#8675 by allowing duplicate identifiers across declara…
…tions. Duplicate identifiers *within the same block* are still disallowed.
- Loading branch information
1 parent
9ffc7a9
commit 115317e
Showing
57 changed files
with
676 additions
and
622 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
44 changes: 0 additions & 44 deletions
44
tests/baselines/reference/classAndInterfaceMergeConflictingMembers.errors.txt
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
tests/baselines/reference/classAndInterfaceMergeConflictingMembers.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,42 @@ | ||
=== tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts === | ||
declare class C1 { | ||
>C1 : Symbol(C1, Decl(classAndInterfaceMergeConflictingMembers.ts, 0, 0), Decl(classAndInterfaceMergeConflictingMembers.ts, 2, 1)) | ||
|
||
public x : number; | ||
>x : Symbol(C1.x, Decl(classAndInterfaceMergeConflictingMembers.ts, 0, 18), Decl(classAndInterfaceMergeConflictingMembers.ts, 4, 14)) | ||
} | ||
|
||
interface C1 { | ||
>C1 : Symbol(C1, Decl(classAndInterfaceMergeConflictingMembers.ts, 0, 0), Decl(classAndInterfaceMergeConflictingMembers.ts, 2, 1)) | ||
|
||
x : number; | ||
>x : Symbol(C1.x, Decl(classAndInterfaceMergeConflictingMembers.ts, 0, 18), Decl(classAndInterfaceMergeConflictingMembers.ts, 4, 14)) | ||
} | ||
|
||
declare class C2 { | ||
>C2 : Symbol(C2, Decl(classAndInterfaceMergeConflictingMembers.ts, 6, 1), Decl(classAndInterfaceMergeConflictingMembers.ts, 10, 1)) | ||
|
||
protected x : number; | ||
>x : Symbol(C2.x, Decl(classAndInterfaceMergeConflictingMembers.ts, 8, 18), Decl(classAndInterfaceMergeConflictingMembers.ts, 12, 14)) | ||
} | ||
|
||
interface C2 { | ||
>C2 : Symbol(C2, Decl(classAndInterfaceMergeConflictingMembers.ts, 6, 1), Decl(classAndInterfaceMergeConflictingMembers.ts, 10, 1)) | ||
|
||
x : number; | ||
>x : Symbol(C2.x, Decl(classAndInterfaceMergeConflictingMembers.ts, 8, 18), Decl(classAndInterfaceMergeConflictingMembers.ts, 12, 14)) | ||
} | ||
|
||
declare class C3 { | ||
>C3 : Symbol(C3, Decl(classAndInterfaceMergeConflictingMembers.ts, 14, 1), Decl(classAndInterfaceMergeConflictingMembers.ts, 18, 1)) | ||
|
||
private x : number; | ||
>x : Symbol(C3.x, Decl(classAndInterfaceMergeConflictingMembers.ts, 16, 18), Decl(classAndInterfaceMergeConflictingMembers.ts, 20, 14)) | ||
} | ||
|
||
interface C3 { | ||
>C3 : Symbol(C3, Decl(classAndInterfaceMergeConflictingMembers.ts, 14, 1), Decl(classAndInterfaceMergeConflictingMembers.ts, 18, 1)) | ||
|
||
x : number; | ||
>x : Symbol(C3.x, Decl(classAndInterfaceMergeConflictingMembers.ts, 16, 18), Decl(classAndInterfaceMergeConflictingMembers.ts, 20, 14)) | ||
} |
42 changes: 42 additions & 0 deletions
42
tests/baselines/reference/classAndInterfaceMergeConflictingMembers.types
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,42 @@ | ||
=== tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts === | ||
declare class C1 { | ||
>C1 : C1 | ||
|
||
public x : number; | ||
>x : number | ||
} | ||
|
||
interface C1 { | ||
>C1 : C1 | ||
|
||
x : number; | ||
>x : number | ||
} | ||
|
||
declare class C2 { | ||
>C2 : C2 | ||
|
||
protected x : number; | ||
>x : number | ||
} | ||
|
||
interface C2 { | ||
>C2 : C2 | ||
|
||
x : number; | ||
>x : number | ||
} | ||
|
||
declare class C3 { | ||
>C3 : C3 | ||
|
||
private x : number; | ||
>x : number | ||
} | ||
|
||
interface C3 { | ||
>C3 : C3 | ||
|
||
x : number; | ||
>x : number | ||
} |
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.