Merge branch 'master' into excess-property-check-numeric-indexers

This commit is contained in:
Nathan Shively-Sanders 2016-05-25 10:56:15 -07:00
commit 41db405f4c
22 changed files with 129 additions and 98 deletions

View file

@ -726,24 +726,40 @@ function runConsoleTests(defaultReporter, defaultSubsets) {
subsetRegexes = subsets.map(function (sub) { return "^" + sub + ".*$"; });
subsetRegexes.push("^(?!" + subsets.join("|") + ").*$");
}
var counter = subsetRegexes.length;
var errorStatus;
subsetRegexes.forEach(function (subsetRegex, i) {
tests = subsetRegex ? ' -g "' + subsetRegex + '"' : '';
var cmd = "mocha" + (debug ? " --debug-brk" : "") + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run;
console.log(cmd);
function finish() {
function finish(status) {
counter--;
// save first error status
if (status !== undefined && errorStatus === undefined) {
errorStatus = status;
}
deleteTemporaryProjectOutput();
complete();
if (counter !== 0 || errorStatus === undefined) {
// run linter when last worker is finished
if (lintFlag && counter === 0) {
var lint = jake.Task['lint'];
lint.addListener('complete', function () {
complete();
});
lint.invoke();
}
complete();
}
else {
fail("Process exited with code " + status);
}
}
exec(cmd, function () {
if (lintFlag && i === 0) {
var lint = jake.Task['lint'];
lint.addListener('complete', function () {
complete();
});
lint.invoke();
}
finish();
}, finish);
}, function(e, status) {
finish(status);
});
});
}

View file

@ -12975,18 +12975,20 @@ namespace ts {
const names = static ? staticNames : instanceNames;
const memberName = member.name && getPropertyNameForPropertyNameNode(member.name);
switch (member.kind) {
case SyntaxKind.GetAccessor:
addName(names, member.name, memberName, getter);
break;
if (memberName) {
switch (member.kind) {
case SyntaxKind.GetAccessor:
addName(names, member.name, memberName, getter);
break;
case SyntaxKind.SetAccessor:
addName(names, member.name, memberName, setter);
break;
case SyntaxKind.SetAccessor:
addName(names, member.name, memberName, setter);
break;
case SyntaxKind.PropertyDeclaration:
addName(names, member.name, memberName, property);
break;
case SyntaxKind.PropertyDeclaration:
addName(names, member.name, memberName, property);
break;
}
}
}
}

View file

@ -1096,14 +1096,6 @@ namespace FourSlash {
}
addSpanInfoString();
return resultString;
function repeatString(count: number, char: string) {
let result = "";
for (let i = 0; i < count; i++) {
result += char;
}
return result;
}
}
public getBreakpointStatementLocation(pos: number) {
@ -2055,7 +2047,7 @@ namespace FourSlash {
for (let i = 0; i < length; i++) {
const item = items[i];
Harness.IO.log(`name: ${item.text}, kind: ${item.kind}`);
Harness.IO.log(`${repeatString(item.indent, " ")}name: ${item.text}, kind: ${item.kind}, childItems: ${item.childItems.map(child => child.text)}`);
}
}
@ -2742,6 +2734,14 @@ ${code}
fileName: fileName
};
}
function repeatString(count: number, char: string) {
let result = "";
for (let i = 0; i < count; i++) {
result += char;
}
return result;
}
}
namespace FourSlashInterface {

View file

@ -320,6 +320,9 @@ namespace ts.NavigationBar {
case SyntaxKind.EnumMember:
return createItem(node, getTextOfNode((<EnumMember>node).name), ts.ScriptElementKind.memberVariableElement);
case SyntaxKind.InterfaceDeclaration:
return createItem(node, getTextOfNode((<InterfaceDeclaration>node).name), ts.ScriptElementKind.interfaceElement);
case SyntaxKind.CallSignature:
return createItem(node, "()", ts.ScriptElementKind.callSignatureElement);

View file

@ -1,7 +1,7 @@
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(10,15): error TS2687: All declarations of 'x' must have identical modifiers.
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(14,5): error TS2687: All declarations of 'x' must have identical modifiers.
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(18,13): error TS2687: All declarations of 'x' must have identical modifiers.
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts(22,5): error TS2687: All declarations of 'x' must have identical modifiers.
==== tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts (4 errors) ====
@ -16,23 +16,23 @@ tests/cases/conformance/classes/classDeclarations/classAndInterfaceMergeConflict
declare class C2 {
protected x : number;
~
!!! error TS2686: All declarations of 'x' must have identical modifiers.
!!! error TS2687: All declarations of 'x' must have identical modifiers.
}
interface C2 {
x : number;
~
!!! error TS2686: All declarations of 'x' must have identical modifiers.
!!! error TS2687: All declarations of 'x' must have identical modifiers.
}
declare class C3 {
private x : number;
~
!!! error TS2686: All declarations of 'x' must have identical modifiers.
!!! error TS2687: All declarations of 'x' must have identical modifiers.
}
interface C3 {
x : number;
~
!!! error TS2686: All declarations of 'x' must have identical modifiers.
!!! error TS2687: All declarations of 'x' must have identical modifiers.
}

View file

@ -1,8 +1,11 @@
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(4,17): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(4,27): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(5,24): error TS2300: Duplicate identifier 'x'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(5,35): error TS2300: Duplicate identifier 'y'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(9,17): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(9,25): error TS2686: All declarations of 'x' must have identical modifiers.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(10,24): error TS2686: All declarations of 'x' must have identical modifiers.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(9,25): error TS2687: All declarations of 'x' must have identical modifiers.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(10,24): error TS2300: Duplicate identifier 'x'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(10,24): error TS2687: All declarations of 'x' must have identical modifiers.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(14,17): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(19,10): error TS2369: A parameter property is only allowed in a constructor implementation.
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
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(35,10): error TS2369: A parameter property is only allowed in a constructor implementation.
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts (14 errors) ====
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts (17 errors) ====
// Parameter properties are not valid in overloads of constructors
class C {
@ -24,6 +27,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatur
~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
constructor(public x, private y) { }
~
!!! error TS2300: Duplicate identifier 'x'.
~
!!! error TS2300: Duplicate identifier 'y'.
}
class C2 {
@ -31,10 +38,12 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatur
~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
~
!!! error TS2686: All declarations of 'x' must have identical modifiers.
!!! error TS2687: All declarations of 'x' must have identical modifiers.
constructor(public x) { }
~
!!! error TS2686: All declarations of 'x' must have identical modifiers.
!!! error TS2300: Duplicate identifier 'x'.
~
!!! error TS2687: All declarations of 'x' must have identical modifiers.
}
class C3 {

View file

@ -1,10 +1,10 @@
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(11,24): error TS2300: Duplicate identifier 'y'.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(18,5): error TS2686: All declarations of 'y' must have identical modifiers.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(18,5): error TS2687: All declarations of 'y' must have identical modifiers.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(19,25): error TS2300: Duplicate identifier 'y'.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(19,25): error TS2686: All declarations of 'y' must have identical modifiers.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(26,5): error TS2686: All declarations of 'y' must have identical modifiers.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(19,25): error TS2687: All declarations of 'y' must have identical modifiers.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(26,5): error TS2687: All declarations of 'y' must have identical modifiers.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(27,27): error TS2300: Duplicate identifier 'y'.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(27,27): error TS2686: All declarations of 'y' must have identical modifiers.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(27,27): error TS2687: All declarations of 'y' must have identical modifiers.
==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts (7 errors) ====
@ -29,12 +29,12 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co
class E {
y: number;
~
!!! error TS2686: All declarations of 'y' must have identical modifiers.
!!! error TS2687: All declarations of 'y' must have identical modifiers.
constructor(private y: number) { } // error
~
!!! error TS2300: Duplicate identifier 'y'.
~
!!! error TS2686: All declarations of 'y' must have identical modifiers.
!!! error TS2687: All declarations of 'y' must have identical modifiers.
}
var e: E;
@ -43,12 +43,12 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co
class F {
y: number;
~
!!! error TS2686: All declarations of 'y' must have identical modifiers.
!!! error TS2687: All declarations of 'y' must have identical modifiers.
constructor(protected y: number) { } // error
~
!!! error TS2300: Duplicate identifier 'y'.
~
!!! error TS2686: All declarations of 'y' must have identical modifiers.
!!! error TS2687: All declarations of 'y' must have identical modifiers.
}
var f: F;

View file

@ -1,4 +1,4 @@
tests/cases/compiler/duplicateIdentifierComputedName.ts(3,5): error TS2300: Duplicate identifier 'a'.
tests/cases/compiler/duplicateIdentifierComputedName.ts(3,5): error TS2300: Duplicate identifier '["a"]'.
==== tests/cases/compiler/duplicateIdentifierComputedName.ts (1 errors) ====
@ -6,6 +6,6 @@ tests/cases/compiler/duplicateIdentifierComputedName.ts(3,5): error TS2300: Dupl
["a"]: string;
["a"]: string;
~~~~~
!!! error TS2300: Duplicate identifier 'a'.
!!! error TS2300: Duplicate identifier '["a"]'.
}

View file

@ -1,17 +1,17 @@
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(2,15): error TS2686: All declarations of 'x' must have identical modifiers.
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(3,15): error TS2686: All declarations of 'x' must have identical modifiers.
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(16,11): error TS2686: All declarations of 'y' must have identical modifiers.
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(20,3): error TS2686: All declarations of 'y' must have identical modifiers.
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(2,15): error TS2687: All declarations of 'x' must have identical modifiers.
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(3,15): error TS2687: All declarations of 'x' must have identical modifiers.
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(16,11): error TS2687: All declarations of 'y' must have identical modifiers.
tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(20,3): error TS2687: All declarations of 'y' must have identical modifiers.
==== tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts (4 errors) ====
// Not OK
interface B { x; }
~
!!! error TS2686: All declarations of 'x' must have identical modifiers.
!!! error TS2687: All declarations of 'x' must have identical modifiers.
interface B { x?; }
~
!!! error TS2686: All declarations of 'x' must have identical modifiers.
!!! error TS2687: All declarations of 'x' must have identical modifiers.
// OK
class A {
@ -26,12 +26,12 @@ tests/cases/compiler/duplicateIdentifierDifferentModifiers.ts(20,3): error TS268
class C {
private y: string;
~
!!! error TS2686: All declarations of 'y' must have identical modifiers.
!!! error TS2687: All declarations of 'y' must have identical modifiers.
}
interface C {
y: string;
~
!!! error TS2686: All declarations of 'y' must have identical modifiers.
!!! error TS2687: All declarations of 'y' must have identical modifiers.
}

View file

@ -1,5 +1,5 @@
tests/cases/compiler/numericClassMembers1.ts(3,3): error TS2300: Duplicate identifier '0'.
tests/cases/compiler/numericClassMembers1.ts(8,2): error TS2300: Duplicate identifier '0'.
tests/cases/compiler/numericClassMembers1.ts(3,3): error TS2300: Duplicate identifier '0.0'.
tests/cases/compiler/numericClassMembers1.ts(8,2): error TS2300: Duplicate identifier ''0''.
==== tests/cases/compiler/numericClassMembers1.ts (2 errors) ====
@ -7,14 +7,14 @@ tests/cases/compiler/numericClassMembers1.ts(8,2): error TS2300: Duplicate ident
0 = 1;
0.0 = 2;
~~~
!!! error TS2300: Duplicate identifier '0'.
!!! error TS2300: Duplicate identifier '0.0'.
}
class C235 {
0.0 = 1;
'0' = 2;
~~~
!!! error TS2300: Duplicate identifier '0'.
!!! error TS2300: Duplicate identifier ''0''.
}
class C236 {

View file

@ -1,4 +1,4 @@
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(3,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(3,5): error TS2300: Duplicate identifier '1.0'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(5,12): error TS2300: Duplicate identifier '2'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(9,5): error TS2300: Duplicate identifier '2'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(10,5): error TS2300: Duplicate identifier '2'.
@ -12,7 +12,7 @@ tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedP
1: number;
1.0: number;
~~~
!!! error TS2300: Duplicate identifier '1'.
!!! error TS2300: Duplicate identifier '1.0'.
static 2: number;
static 2: number;
~

View file

@ -1,4 +1,4 @@
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(6,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(6,5): error TS2300: Duplicate identifier '1.0'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(10,5): error TS2300: Duplicate identifier '1'.
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'.
@ -15,7 +15,7 @@ tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericString
"1.0": number; // not a duplicate
1.0: number;
~~~
!!! error TS2300: Duplicate identifier '1'.
!!! error TS2300: Duplicate identifier '1.0'.
}
interface I {

View file

@ -1,6 +1,6 @@
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(6,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(7,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(8,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(6,5): error TS2300: Duplicate identifier '1.0'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(7,5): error TS2300: Duplicate identifier '1.'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(8,5): error TS2300: Duplicate identifier '1.00'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(12,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(13,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(14,5): error TS2300: Duplicate identifier '1'.
@ -22,13 +22,13 @@ tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(
1;
1.0;
~~~
!!! error TS2300: Duplicate identifier '1'.
!!! error TS2300: Duplicate identifier '1.0'.
1.;
~~
!!! error TS2300: Duplicate identifier '1'.
!!! error TS2300: Duplicate identifier '1.'.
1.00;
~~~~
!!! error TS2300: Duplicate identifier '1'.
!!! error TS2300: Duplicate identifier '1.00'.
}
interface I {

View file

@ -5,9 +5,9 @@ tests/cases/compiler/optionalPropertiesSyntax.ts(12,5): error TS1131: Property o
tests/cases/compiler/optionalPropertiesSyntax.ts(18,11): error TS1005: ';' expected.
tests/cases/compiler/optionalPropertiesSyntax.ts(18,12): error TS1131: Property or signature expected.
tests/cases/compiler/optionalPropertiesSyntax.ts(24,5): error TS2300: Duplicate identifier 'prop'.
tests/cases/compiler/optionalPropertiesSyntax.ts(24,5): error TS2686: All declarations of 'prop' must have identical modifiers.
tests/cases/compiler/optionalPropertiesSyntax.ts(24,5): error TS2687: All declarations of 'prop' must have identical modifiers.
tests/cases/compiler/optionalPropertiesSyntax.ts(25,5): error TS2300: Duplicate identifier 'prop'.
tests/cases/compiler/optionalPropertiesSyntax.ts(25,5): error TS2686: All declarations of 'prop' must have identical modifiers.
tests/cases/compiler/optionalPropertiesSyntax.ts(25,5): error TS2687: All declarations of 'prop' must have identical modifiers.
tests/cases/compiler/optionalPropertiesSyntax.ts(32,5): error TS2375: Duplicate number index signature.
tests/cases/compiler/optionalPropertiesSyntax.ts(32,18): error TS1005: ';' expected.
tests/cases/compiler/optionalPropertiesSyntax.ts(32,19): error TS1131: Property or signature expected.
@ -56,12 +56,12 @@ tests/cases/compiler/optionalPropertiesSyntax.ts(34,5): error TS2375: Duplicate
~~~~
!!! error TS2300: Duplicate identifier 'prop'.
~~~~
!!! error TS2686: All declarations of 'prop' must have identical modifiers.
!!! error TS2687: All declarations of 'prop' must have identical modifiers.
prop?: any;
~~~~
!!! error TS2300: Duplicate identifier 'prop'.
~~~~
!!! error TS2686: All declarations of 'prop' must have identical modifiers.
!!! error TS2687: All declarations of 'prop' must have identical modifiers.
prop2?: any;
}

View file

@ -1,8 +1,9 @@
tests/cases/compiler/parameterPropertyInConstructor2.ts(3,5): error TS2394: Overload signature is not compatible with function implementation.
tests/cases/compiler/parameterPropertyInConstructor2.ts(3,17): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/compiler/parameterPropertyInConstructor2.ts(4,24): error TS2300: Duplicate identifier 'names'.
==== tests/cases/compiler/parameterPropertyInConstructor2.ts (2 errors) ====
==== tests/cases/compiler/parameterPropertyInConstructor2.ts (3 errors) ====
module mod {
class Customers {
constructor(public names: string);
@ -11,6 +12,8 @@ tests/cases/compiler/parameterPropertyInConstructor2.ts(3,17): error TS2369: A p
~~~~~~~~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
constructor(public names: string, public ages: number) {
~~~~~
!!! error TS2300: Duplicate identifier 'names'.
}
}
}

View file

@ -1,5 +1,5 @@
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(3,5): error TS2300: Duplicate identifier 'a b'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(5,12): error TS2300: Duplicate identifier 'c d'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(3,5): error TS2300: Duplicate identifier '"a b"'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(5,12): error TS2300: Duplicate identifier '"c d"'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(9,5): error TS2300: Duplicate identifier 'a b'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(10,5): error TS2300: Duplicate identifier 'a b'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(14,5): error TS2300: Duplicate identifier 'a b'.
@ -12,11 +12,11 @@ tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPr
"a b": number;
"a b": number;
~~~~~
!!! error TS2300: Duplicate identifier 'a b'.
!!! error TS2300: Duplicate identifier '"a b"'.
static "c d": number;
static "c d": number;
~~~~~
!!! error TS2300: Duplicate identifier 'c d'.
!!! error TS2300: Duplicate identifier '"c d"'.
}
interface I {

View file

@ -1,9 +1,8 @@
tests/cases/conformance/es6/Symbols/symbolProperty44.ts(2,9): error TS2300: Duplicate identifier '[Symbol.hasInstance]'.
tests/cases/conformance/es6/Symbols/symbolProperty44.ts(5,9): error TS2300: Duplicate identifier '[Symbol.hasInstance]'.
tests/cases/conformance/es6/Symbols/symbolProperty44.ts(5,9): error TS2300: Duplicate identifier '__@hasInstance'.
==== tests/cases/conformance/es6/Symbols/symbolProperty44.ts (3 errors) ====
==== tests/cases/conformance/es6/Symbols/symbolProperty44.ts (2 errors) ====
class C {
get [Symbol.hasInstance]() {
~~~~~~~~~~~~~~~~~~~~
@ -13,8 +12,6 @@ tests/cases/conformance/es6/Symbols/symbolProperty44.ts(5,9): error TS2300: Dupl
get [Symbol.hasInstance]() {
~~~~~~~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier '[Symbol.hasInstance]'.
~~~~~~~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier '__@hasInstance'.
return "";
}
}

View file

@ -6,7 +6,7 @@
////
//// }
////
//// {| "itemName": "LocalInterfaceInConstrcutor", "kind": "interface", "parentName": ""|}interface LocalInterfaceInConstrcutor {
//// {| "itemName": "LocalInterfaceInConstrcutor", "kind": "interface", "parentName": "constructor"|}interface LocalInterfaceInConstrcutor {
//// }
////
//// {| "itemName": "LocalEnumInConstructor", "kind": "enum", "parentName": "constructor"|}enum LocalEnumInConstructor {
@ -21,7 +21,7 @@
//// }
//// }
////
//// {| "itemName": "LocalInterfaceInMethod", "kind": "interface", "parentName": ""|}interface LocalInterfaceInMethod {
//// {| "itemName": "LocalInterfaceInMethod", "kind": "interface", "parentName": "method"|}interface LocalInterfaceInMethod {
//// }
////
//// {| "itemName": "LocalEnumInMethod", "kind": "enum", "parentName": "method"|}enum LocalEnumInMethod {
@ -39,4 +39,4 @@ test.markers().forEach((marker) => {
});
// no other items
verify.navigationBarCount(19);
verify.navigationBarCount(21);

View file

@ -1,7 +1,7 @@
/// <reference path="fourslash.ts"/>
////// Interface
////{| "itemName": "IPoint", "kind": "interface", "parentName": "" |}interface IPoint {
////{| "itemName": "IPoint", "kind": "interface", "parentName": "<global>" |}interface IPoint {
//// {| "itemName": "getDist", "kind": "method", "parentName": "IPoint" |}getDist(): number;
//// {| "itemName": "new()", "kind": "construct", "parentName": "IPoint" |}new(): IPoint;
//// {| "itemName": "()", "kind": "call", "parentName": "IPoint" |}(): any;
@ -49,4 +49,4 @@ test.markers().forEach((marker) => {
}
});
verify.navigationBarCount(24);
verify.navigationBarCount(25);

View file

@ -10,7 +10,7 @@
////{| "itemName": "\"MultilineMadness\"", "kind": "module" |}
////declare module "MultilineMadness" {}
////
////{| "itemName": "Foo", "kind": "interface" |}
////{| "itemName": "Foo", "kind": "interface", "parentName": "<global>" |}
////interface Foo {
//// {| "itemName": "\"a1\\\\\\r\\nb\"", "kind": "property", "parentName": "Foo" |}
//// "a1\\\r\nb";
@ -38,4 +38,4 @@ test.markers().forEach((marker) => {
verify.navigationBarContains(marker.data.itemName, marker.data.kind, marker.fileName, marker.data.parentName);
});
verify.navigationBarCount(9); // interface w/ 2 properties, class w/ 2 properties, 3 modules
verify.navigationBarCount(11); // interface w/ 2 properties, class w/ 2 properties, 3 modules

View file

@ -1,6 +1,6 @@
/// <reference path="fourslash.ts"/>
////{| "itemName": "I", "kind": "interface", "parentName": "" |}
////{| "itemName": "I", "kind": "interface", "parentName": "<global>" |}
////interface I {
//// {| "itemName": "[Symbol.isRegExp]", "kind": "property", "parentName": "I" |}
//// [Symbol.isRegExp]: string;
@ -12,4 +12,5 @@ test.markers().forEach(marker => {
verify.navigationBarContains(marker.data.itemName, marker.data.kind, marker.fileName, marker.data.parentName);
});
verify.navigationBarCount(test.markers().length);
// 2 are not marked: <global> and its child.
verify.navigationBarCount(2 + test.markers().length);

View file

@ -1,7 +1,7 @@
/// <reference path="../fourslash.ts"/>
////// Interface
////{| "itemName": "IPoint", "kind": "interface", "parentName": "" |}interface IPoint {
////{| "itemName": "IPoint", "kind": "interface", "parentName": "<global>" |}interface IPoint {
//// {| "itemName": "getDist", "kind": "method", "parentName": "IPoint" |}getDist(): number;
//// {| "itemName": "new()", "kind": "construct", "parentName": "IPoint" |}new(): IPoint;
//// {| "itemName": "()", "kind": "call", "parentName": "IPoint" |}(): any;
@ -49,4 +49,4 @@ test.markers().forEach((marker) => {
}
});
verify.navigationBarCount(24);
verify.navigationBarCount(25);