Skip to content

Commit 41db405

Browse files
committed
Merge branch 'master' into excess-property-check-numeric-indexers
2 parents 89fb304 + f5a52ee commit 41db405

22 files changed

+129
-98
lines changed

Jakefile.js

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -726,24 +726,40 @@ function runConsoleTests(defaultReporter, defaultSubsets) {
726726
subsetRegexes = subsets.map(function (sub) { return "^" + sub + ".*$"; });
727727
subsetRegexes.push("^(?!" + subsets.join("|") + ").*$");
728728
}
729+
var counter = subsetRegexes.length;
730+
var errorStatus;
729731
subsetRegexes.forEach(function (subsetRegex, i) {
730732
tests = subsetRegex ? ' -g "' + subsetRegex + '"' : '';
731733
var cmd = "mocha" + (debug ? " --debug-brk" : "") + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run;
732734
console.log(cmd);
733-
function finish() {
735+
function finish(status) {
736+
counter--;
737+
// save first error status
738+
if (status !== undefined && errorStatus === undefined) {
739+
errorStatus = status;
740+
}
741+
734742
deleteTemporaryProjectOutput();
735-
complete();
743+
if (counter !== 0 || errorStatus === undefined) {
744+
// run linter when last worker is finished
745+
if (lintFlag && counter === 0) {
746+
var lint = jake.Task['lint'];
747+
lint.addListener('complete', function () {
748+
complete();
749+
});
750+
lint.invoke();
751+
}
752+
complete();
753+
}
754+
else {
755+
fail("Process exited with code " + status);
756+
}
736757
}
737758
exec(cmd, function () {
738-
if (lintFlag && i === 0) {
739-
var lint = jake.Task['lint'];
740-
lint.addListener('complete', function () {
741-
complete();
742-
});
743-
lint.invoke();
744-
}
745759
finish();
746-
}, finish);
760+
}, function(e, status) {
761+
finish(status);
762+
});
747763
});
748764
}
749765

src/compiler/checker.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12975,18 +12975,20 @@ namespace ts {
1297512975
const names = static ? staticNames : instanceNames;
1297612976

1297712977
const memberName = member.name && getPropertyNameForPropertyNameNode(member.name);
12978-
switch (member.kind) {
12979-
case SyntaxKind.GetAccessor:
12980-
addName(names, member.name, memberName, getter);
12981-
break;
12978+
if (memberName) {
12979+
switch (member.kind) {
12980+
case SyntaxKind.GetAccessor:
12981+
addName(names, member.name, memberName, getter);
12982+
break;
1298212983

12983-
case SyntaxKind.SetAccessor:
12984-
addName(names, member.name, memberName, setter);
12985-
break;
12984+
case SyntaxKind.SetAccessor:
12985+
addName(names, member.name, memberName, setter);
12986+
break;
1298612987

12987-
case SyntaxKind.PropertyDeclaration:
12988-
addName(names, member.name, memberName, property);
12989-
break;
12988+
case SyntaxKind.PropertyDeclaration:
12989+
addName(names, member.name, memberName, property);
12990+
break;
12991+
}
1299012992
}
1299112993
}
1299212994
}

src/harness/fourslash.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,14 +1096,6 @@ namespace FourSlash {
10961096
}
10971097
addSpanInfoString();
10981098
return resultString;
1099-
1100-
function repeatString(count: number, char: string) {
1101-
let result = "";
1102-
for (let i = 0; i < count; i++) {
1103-
result += char;
1104-
}
1105-
return result;
1106-
}
11071099
}
11081100

11091101
public getBreakpointStatementLocation(pos: number) {
@@ -2055,7 +2047,7 @@ namespace FourSlash {
20552047

20562048
for (let i = 0; i < length; i++) {
20572049
const item = items[i];
2058-
Harness.IO.log(`name: ${item.text}, kind: ${item.kind}`);
2050+
Harness.IO.log(`${repeatString(item.indent, " ")}name: ${item.text}, kind: ${item.kind}, childItems: ${item.childItems.map(child => child.text)}`);
20592051
}
20602052
}
20612053

@@ -2742,6 +2734,14 @@ ${code}
27422734
fileName: fileName
27432735
};
27442736
}
2737+
2738+
function repeatString(count: number, char: string) {
2739+
let result = "";
2740+
for (let i = 0; i < count; i++) {
2741+
result += char;
2742+
}
2743+
return result;
2744+
}
27452745
}
27462746

27472747
namespace FourSlashInterface {

src/services/navigationBar.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ namespace ts.NavigationBar {
320320
case SyntaxKind.EnumMember:
321321
return createItem(node, getTextOfNode((<EnumMember>node).name), ts.ScriptElementKind.memberVariableElement);
322322

323+
case SyntaxKind.InterfaceDeclaration:
324+
return createItem(node, getTextOfNode((<InterfaceDeclaration>node).name), ts.ScriptElementKind.interfaceElement);
325+
323326
case SyntaxKind.CallSignature:
324327
return createItem(node, "()", ts.ScriptElementKind.callSignatureElement);
325328

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(10,15): error TS2686: All declarations of 'x' must have identical modifiers.
2-
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(14,5): error TS2686: All declarations of 'x' must have identical modifiers.
3-
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(18,13): error TS2686: All declarations of 'x' must have identical modifiers.
4-
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(22,5): error TS2686: All declarations of 'x' must have identical modifiers.
1+
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(10,15): error TS2687: All declarations of 'x' must have identical modifiers.
2+
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(14,5): error TS2687: All declarations of 'x' must have identical modifiers.
3+
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(18,13): error TS2687: All declarations of 'x' must have identical modifiers.
4+
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(22,5): error TS2687: All declarations of 'x' must have identical modifiers.
55

66

77
==== tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts (4 errors) ====
@@ -16,23 +16,23 @@ tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflict
1616
declare class C2 {
1717
protected x : number;
1818
~
19-
!!! error TS2686: All declarations of 'x' must have identical modifiers.
19+
!!! error TS2687: All declarations of 'x' must have identical modifiers.
2020
}
2121

2222
interface C2 {
2323
x : number;
2424
~
25-
!!! error TS2686: All declarations of 'x' must have identical modifiers.
25+
!!! error TS2687: All declarations of 'x' must have identical modifiers.
2626
}
2727

2828
declare class C3 {
2929
private x : number;
3030
~
31-
!!! error TS2686: All declarations of 'x' must have identical modifiers.
31+
!!! error TS2687: All declarations of 'x' must have identical modifiers.
3232
}
3333

3434
interface C3 {
3535
x : number;
3636
~
37-
!!! error TS2686: All declarations of 'x' must have identical modifiers.
37+
!!! error TS2687: All declarations of 'x' must have identical modifiers.
3838
}

tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.errors.txt

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(4,17): error TS2369: A parameter property is only allowed in a constructor implementation.
22
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(4,27): error TS2369: A parameter property is only allowed in a constructor implementation.
3+
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(5,24): error TS2300: Duplicate identifier 'x'.
4+
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(5,35): error TS2300: Duplicate identifier 'y'.
35
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(9,17): error TS2369: A parameter property is only allowed in a constructor implementation.
4-
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(9,25): error TS2686: All declarations of 'x' must have identical modifiers.
5-
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(10,24): error TS2686: All declarations of 'x' must have identical modifiers.
6+
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(9,25): error TS2687: All declarations of 'x' must have identical modifiers.
7+
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(10,24): error TS2300: Duplicate identifier 'x'.
8+
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(10,24): error TS2687: All declarations of 'x' must have identical modifiers.
69
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(14,17): error TS2369: A parameter property is only allowed in a constructor implementation.
710
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(19,10): error TS2369: A parameter property is only allowed in a constructor implementation.
811
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(20,10): error TS2369: A parameter property is only allowed in a constructor implementation.
@@ -14,7 +17,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatur
1417
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(35,10): error TS2369: A parameter property is only allowed in a constructor implementation.
1518

1619

17-
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts (14 errors) ====
20+
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts (17 errors) ====
1821
// Parameter properties are not valid in overloads of constructors
1922

2023
class C {
@@ -24,17 +27,23 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatur
2427
~~~~~~~~~
2528
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
2629
constructor(public x, private y) { }
30+
~
31+
!!! error TS2300: Duplicate identifier 'x'.
32+
~
33+
!!! error TS2300: Duplicate identifier 'y'.
2734
}
2835

2936
class C2 {
3037
constructor(private x);
3138
~~~~~~~~~
3239
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
3340
~
34-
!!! error TS2686: All declarations of 'x' must have identical modifiers.
41+
!!! error TS2687: All declarations of 'x' must have identical modifiers.
3542
constructor(public x) { }
3643
~
37-
!!! error TS2686: All declarations of 'x' must have identical modifiers.
44+
!!! error TS2300: Duplicate identifier 'x'.
45+
~
46+
!!! error TS2687: All declarations of 'x' must have identical modifiers.
3847
}
3948

4049
class C3 {

tests/baselines/reference/constructorParameterProperties2.errors.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(11,24): error TS2300: Duplicate identifier 'y'.
2-
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(18,5): error TS2686: All declarations of 'y' must have identical modifiers.
2+
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(18,5): error TS2687: All declarations of 'y' must have identical modifiers.
33
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(19,25): error TS2300: Duplicate identifier 'y'.
4-
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(19,25): error TS2686: All declarations of 'y' must have identical modifiers.
5-
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(26,5): error TS2686: All declarations of 'y' must have identical modifiers.
4+
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(19,25): error TS2687: All declarations of 'y' must have identical modifiers.
5+
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(26,5): error TS2687: All declarations of 'y' must have identical modifiers.
66
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(27,27): error TS2300: Duplicate identifier 'y'.
7-
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(27,27): error TS2686: All declarations of 'y' must have identical modifiers.
7+
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(27,27): error TS2687: All declarations of 'y' must have identical modifiers.
88

99

1010
==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts (7 errors) ====
@@ -29,12 +29,12 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co
2929
class E {
3030
y: number;
3131
~
32-
!!! error TS2686: All declarations of 'y' must have identical modifiers.
32+
!!! error TS2687: All declarations of 'y' must have identical modifiers.
3333
constructor(private y: number) { } // error
3434
~
3535
!!! error TS2300: Duplicate identifier 'y'.
3636
~
37-
!!! error TS2686: All declarations of 'y' must have identical modifiers.
37+
!!! error TS2687: All declarations of 'y' must have identical modifiers.
3838
}
3939

4040
var e: E;
@@ -43,12 +43,12 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co
4343
class F {
4444
y: number;
4545
~
46-
!!! error TS2686: All declarations of 'y' must have identical modifiers.
46+
!!! error TS2687: All declarations of 'y' must have identical modifiers.
4747
constructor(protected y: number) { } // error
4848
~
4949
!!! error TS2300: Duplicate identifier 'y'.
5050
~
51-
!!! error TS2686: All declarations of 'y' must have identical modifiers.
51+
!!! error TS2687: All declarations of 'y' must have identical modifiers.
5252
}
5353

5454
var f: F;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
tests/cases/compiler/duplicateIdentifierComputedName.ts(3,5): error TS2300: Duplicate identifier 'a'.
1+
tests/cases/compiler/duplicateIdentifierComputedName.ts(3,5): error TS2300: Duplicate identifier '["a"]'.
22

33

44
==== tests/cases/compiler/duplicateIdentifierComputedName.ts (1 errors) ====
55
class C {
66
["a"]: string;
77
["a"]: string;
88
~~~~~
9-
!!! error TS2300: Duplicate identifier 'a'.
9+
!!! error TS2300: Duplicate identifier '["a"]'.
1010
}
1111

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(2,15): error TS2686: All declarations of 'x' must have identical modifiers.
2-
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(3,15): error TS2686: All declarations of 'x' must have identical modifiers.
3-
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(16,11): error TS2686: All declarations of 'y' must have identical modifiers.
4-
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(20,3): error TS2686: All declarations of 'y' must have identical modifiers.
1+
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(2,15): error TS2687: All declarations of 'x' must have identical modifiers.
2+
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(3,15): error TS2687: All declarations of 'x' must have identical modifiers.
3+
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(16,11): error TS2687: All declarations of 'y' must have identical modifiers.
4+
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(20,3): error TS2687: All declarations of 'y' must have identical modifiers.
55

66

77
==== tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts (4 errors) ====
88
// Not OK
99
interface B { x; }
1010
~
11-
!!! error TS2686: All declarations of 'x' must have identical modifiers.
11+
!!! error TS2687: All declarations of 'x' must have identical modifiers.
1212
interface B { x?; }
1313
~
14-
!!! error TS2686: All declarations of 'x' must have identical modifiers.
14+
!!! error TS2687: All declarations of 'x' must have identical modifiers.
1515

1616
// OK
1717
class A {
@@ -26,12 +26,12 @@ tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(20,3): error TS268
2626
class C {
2727
private y: string;
2828
~
29-
!!! error TS2686: All declarations of 'y' must have identical modifiers.
29+
!!! error TS2687: All declarations of 'y' must have identical modifiers.
3030
}
3131

3232
interface C {
3333
y: string;
3434
~
35-
!!! error TS2686: All declarations of 'y' must have identical modifiers.
35+
!!! error TS2687: All declarations of 'y' must have identical modifiers.
3636
}
3737

tests/baselines/reference/numericClassMembers1.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
tests/cases/compiler/numericClassMembers1.ts(3,3): error TS2300: Duplicate identifier '0'.
2-
tests/cases/compiler/numericClassMembers1.ts(8,2): error TS2300: Duplicate identifier '0'.
1+
tests/cases/compiler/numericClassMembers1.ts(3,3): error TS2300: Duplicate identifier '0.0'.
2+
tests/cases/compiler/numericClassMembers1.ts(8,2): error TS2300: Duplicate identifier ''0''.
33

44

55
==== tests/cases/compiler/numericClassMembers1.ts (2 errors) ====
66
class C234 {
77
0 = 1;
88
0.0 = 2;
99
~~~
10-
!!! error TS2300: Duplicate identifier '0'.
10+
!!! error TS2300: Duplicate identifier '0.0'.
1111
}
1212

1313
class C235 {
1414
0.0 = 1;
1515
'0' = 2;
1616
~~~
17-
!!! error TS2300: Duplicate identifier '0'.
17+
!!! error TS2300: Duplicate identifier ''0''.
1818
}
1919

2020
class C236 {

0 commit comments

Comments
 (0)