mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-20 10:29:36 -06:00
Allow duplicate identifiers as long as their declarations span multiple blocks
Fixes #8675
This commit is contained in:
parent
27292e4292
commit
675d176cef
@ -12954,6 +12954,82 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function checkClassForDuplicateDeclarations(node: ClassLikeDeclaration) {
|
||||
const getter = 1, setter = 2, property = getter | setter;
|
||||
|
||||
const instanceNames: Map<number> = {};
|
||||
const staticNames: Map<number> = {};
|
||||
for (const member of node.members) {
|
||||
if (member.kind === SyntaxKind.Constructor) {
|
||||
for (const param of (member as ConstructorDeclaration).parameters) {
|
||||
if (isParameterPropertyDeclaration(param)) {
|
||||
addName(instanceNames, param.name, (param.name as Identifier).text, property);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
const static = forEach(member.modifiers, m => m.kind === SyntaxKind.StaticKeyword);
|
||||
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;
|
||||
|
||||
case SyntaxKind.SetAccessor:
|
||||
addName(names, member.name, memberName, setter);
|
||||
break;
|
||||
|
||||
case SyntaxKind.PropertyDeclaration:
|
||||
addName(names, member.name, memberName, property);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addName(names: Map<number>, location: Node, name: string, meaning: number) {
|
||||
if (hasProperty(names, name)) {
|
||||
const prev = names[name];
|
||||
if (prev & meaning) {
|
||||
error(location, Diagnostics.Duplicate_identifier_0, getTextOfNode(location));
|
||||
}
|
||||
else {
|
||||
names[name] = prev | meaning;
|
||||
}
|
||||
}
|
||||
else {
|
||||
names[name] = meaning;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkObjectTypeForDuplicateDeclarations(node: TypeLiteralNode | InterfaceDeclaration) {
|
||||
const names: Map<boolean> = {};
|
||||
for (const member of node.members) {
|
||||
if (member.kind == SyntaxKind.PropertySignature) {
|
||||
let memberName: string;
|
||||
switch (member.name.kind) {
|
||||
case SyntaxKind.StringLiteral:
|
||||
case SyntaxKind.NumericLiteral:
|
||||
case SyntaxKind.Identifier:
|
||||
memberName = (member.name as LiteralExpression | Identifier).text;
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
if (hasProperty(names, memberName)) {
|
||||
error(member.symbol.valueDeclaration.name, Diagnostics.Duplicate_identifier_0, memberName);
|
||||
error(member.name, Diagnostics.Duplicate_identifier_0, memberName);
|
||||
}
|
||||
else {
|
||||
names[memberName] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkTypeForDuplicateIndexSignatures(node: Node) {
|
||||
if (node.kind === SyntaxKind.InterfaceDeclaration) {
|
||||
const nodeSymbol = getSymbolOfNode(node);
|
||||
@ -13238,6 +13314,7 @@ namespace ts {
|
||||
const type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
|
||||
checkIndexConstraints(type);
|
||||
checkTypeForDuplicateIndexSignatures(node);
|
||||
checkObjectTypeForDuplicateDeclarations(node);
|
||||
}
|
||||
}
|
||||
|
||||
@ -14430,6 +14507,10 @@ namespace ts {
|
||||
if (node.initializer) {
|
||||
checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, /*headMessage*/ undefined);
|
||||
}
|
||||
if (!areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) {
|
||||
error(symbol.valueDeclaration.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name));
|
||||
error(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name));
|
||||
}
|
||||
}
|
||||
if (node.kind !== SyntaxKind.PropertyDeclaration && node.kind !== SyntaxKind.PropertySignature) {
|
||||
// We know we don't have a binding pattern or computed name here
|
||||
@ -14444,6 +14525,21 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function areDeclarationFlagsIdentical(left: Declaration, right: Declaration) {
|
||||
if (hasQuestionToken(left) !== hasQuestionToken(right)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const interestingFlags = NodeFlags.Private |
|
||||
NodeFlags.Protected |
|
||||
NodeFlags.Async |
|
||||
NodeFlags.Abstract |
|
||||
NodeFlags.Readonly |
|
||||
NodeFlags.Static;
|
||||
|
||||
return (left.flags & interestingFlags) === (right.flags & interestingFlags);
|
||||
}
|
||||
|
||||
function checkVariableDeclaration(node: VariableDeclaration) {
|
||||
checkGrammarVariableDeclaration(node);
|
||||
return checkVariableLikeDeclaration(node);
|
||||
@ -15237,6 +15333,7 @@ namespace ts {
|
||||
const typeWithThis = getTypeWithThisArgument(type);
|
||||
const staticType = <ObjectType>getTypeOfSymbol(symbol);
|
||||
checkTypeParameterListsIdentical(node, symbol);
|
||||
checkClassForDuplicateDeclarations(node);
|
||||
|
||||
const baseTypeNode = getClassExtendsHeritageClauseElement(node);
|
||||
if (baseTypeNode) {
|
||||
@ -15514,6 +15611,7 @@ namespace ts {
|
||||
checkIndexConstraints(type);
|
||||
}
|
||||
}
|
||||
checkObjectTypeForDuplicateDeclarations(node);
|
||||
}
|
||||
forEach(getInterfaceBaseTypeNodes(node), heritageElement => {
|
||||
if (!isSupportedExpressionWithTypeArguments(heritageElement)) {
|
||||
@ -18152,7 +18250,6 @@ namespace ts {
|
||||
name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
// If the name is not a ComputedPropertyName, the grammar checking will skip it
|
||||
checkGrammarComputedPropertyName(<ComputedPropertyName>name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (prop.kind === SyntaxKind.ShorthandPropertyAssignment && !inDestructuring && (<ShorthandPropertyAssignment>prop).objectAssignmentInitializer) {
|
||||
@ -18198,17 +18295,22 @@ namespace ts {
|
||||
Debug.fail("Unexpected syntax kind:" + prop.kind);
|
||||
}
|
||||
|
||||
if (!hasProperty(seen, (<Identifier>name).text)) {
|
||||
seen[(<Identifier>name).text] = currentKind;
|
||||
const effectiveName = getPropertyNameForPropertyNameNode(name);
|
||||
if (effectiveName === undefined) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!hasProperty(seen, effectiveName)) {
|
||||
seen[effectiveName] = currentKind;
|
||||
}
|
||||
else {
|
||||
const existingKind = seen[(<Identifier>name).text];
|
||||
const existingKind = seen[effectiveName];
|
||||
if (currentKind === Property && existingKind === Property) {
|
||||
continue;
|
||||
grammarErrorOnNode(name, Diagnostics.Duplicate_identifier_0, getTextOfNode(name));
|
||||
}
|
||||
else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) {
|
||||
if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) {
|
||||
seen[(<Identifier>name).text] = currentKind | existingKind;
|
||||
seen[effectiveName] = currentKind | existingKind;
|
||||
}
|
||||
else {
|
||||
return grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);
|
||||
|
||||
@ -1927,6 +1927,10 @@
|
||||
"category": "Error",
|
||||
"code": 2686
|
||||
},
|
||||
"All declarations of '{0}' must have identical modifiers.": {
|
||||
"category": "Error",
|
||||
"code": 2687
|
||||
},
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
"code": 4000
|
||||
|
||||
@ -2025,7 +2025,7 @@ namespace ts {
|
||||
BlockScopedVariableExcludes = Value,
|
||||
|
||||
ParameterExcludes = Value,
|
||||
PropertyExcludes = Value,
|
||||
PropertyExcludes = None,
|
||||
EnumMemberExcludes = Value,
|
||||
FunctionExcludes = Value & ~(Function | ValueModule),
|
||||
ClassExcludes = (Value | Type) & ~(ValueModule | Interface), // class-interface mergability done in checker.ts
|
||||
|
||||
@ -1774,7 +1774,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function getPropertyNameForPropertyNameNode(name: DeclarationName): string {
|
||||
if (name.kind === SyntaxKind.Identifier || name.kind === SyntaxKind.StringLiteral || name.kind === SyntaxKind.NumericLiteral) {
|
||||
if (name.kind === SyntaxKind.Identifier || name.kind === SyntaxKind.StringLiteral || name.kind === SyntaxKind.NumericLiteral || name.kind === SyntaxKind.Parameter) {
|
||||
return (<Identifier | LiteralExpression>name).text;
|
||||
}
|
||||
if (name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
|
||||
@ -1,11 +1,8 @@
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts(2,17): error TS1005: ',' expected.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts(3,17): error TS1005: ',' expected.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts(6,5): error TS2300: Duplicate identifier '0b11010'.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts(7,5): error TS2300: Duplicate identifier '26'.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts(8,5): error TS2300: Duplicate identifier '"26"'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts (5 errors) ====
|
||||
==== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts (2 errors) ====
|
||||
// error
|
||||
var bin1 = 0B1102110;
|
||||
~~~~
|
||||
@ -16,13 +13,7 @@ tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralErr
|
||||
|
||||
var obj1 = {
|
||||
0b11010: "hi",
|
||||
~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier '0b11010'.
|
||||
26: "Hello",
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier '26'.
|
||||
"26": "world",
|
||||
~~~~
|
||||
!!! error TS2300: Duplicate identifier '"26"'.
|
||||
};
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(4,14): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(11,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(20,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(20,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(20,15): error TS1005: '{' expected.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(21,5): error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts (6 errors) ====
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts (4 errors) ====
|
||||
// Optional parameters allow initializers only in implementation signatures
|
||||
// All the below declarations are errors
|
||||
|
||||
@ -31,15 +29,11 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWit
|
||||
|
||||
var b = {
|
||||
foo(x = 1), // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
~~~~~
|
||||
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||
~
|
||||
!!! error TS1005: '{' expected.
|
||||
foo(x = 1) { }, // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
}
|
||||
|
||||
b.foo();
|
||||
|
||||
@ -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.
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts(1,11): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts(2,15): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts(6,9): error TS2300: Duplicate identifier 'bar'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts(10,9): error TS2300: Duplicate identifier 'bar'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts (4 errors) ====
|
||||
class C { foo: string; }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
interface C { foo: string; }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
module M {
|
||||
class D {
|
||||
bar: string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'bar'.
|
||||
}
|
||||
|
||||
interface D {
|
||||
bar: string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'bar'.
|
||||
}
|
||||
}
|
||||
@ -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))
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
=== tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts ===
|
||||
class C { foo: string; }
|
||||
>C : C
|
||||
>foo : string
|
||||
|
||||
interface C { foo: string; }
|
||||
>C : C
|
||||
>foo : string
|
||||
|
||||
module M {
|
||||
>M : typeof M
|
||||
|
||||
class D {
|
||||
>D : D
|
||||
|
||||
bar: string;
|
||||
>bar : string
|
||||
}
|
||||
|
||||
interface D {
|
||||
>D : D
|
||||
|
||||
bar: string;
|
||||
>bar : string
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,8 @@
|
||||
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,24): error TS2300: Duplicate identifier 'x'.
|
||||
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(4,35): error TS2300: Duplicate identifier 'y'.
|
||||
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 TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(10,24): error TS2300: Duplicate identifier 'x'.
|
||||
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(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.
|
||||
@ -18,24 +14,16 @@ 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 (18 errors) ====
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts (14 errors) ====
|
||||
// Parameter properties are not valid in overloads of constructors
|
||||
|
||||
class C {
|
||||
constructor(public x, private y);
|
||||
~~~~~~~~
|
||||
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~~~~~~~~~
|
||||
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'y'.
|
||||
constructor(public x, private y) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'y'.
|
||||
}
|
||||
|
||||
class C2 {
|
||||
@ -43,10 +31,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatur
|
||||
~~~~~~~~~
|
||||
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
!!! error TS2686: All declarations of 'x' must have identical modifiers.
|
||||
constructor(public x) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
!!! error TS2686: All declarations of 'x' must have identical modifiers.
|
||||
}
|
||||
|
||||
class C3 {
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(10,5): error TS2300: Duplicate identifier 'y'.
|
||||
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 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(19,25): error TS2300: Duplicate identifier 'y'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(26,5): 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(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 (6 errors) ====
|
||||
==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts (7 errors) ====
|
||||
class C {
|
||||
y: number;
|
||||
constructor(y: number) { } // ok
|
||||
@ -17,8 +18,6 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co
|
||||
|
||||
class D {
|
||||
y: number;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'y'.
|
||||
constructor(public y: number) { } // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'y'.
|
||||
@ -30,10 +29,12 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co
|
||||
class E {
|
||||
y: number;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'y'.
|
||||
!!! error TS2686: 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.
|
||||
}
|
||||
|
||||
var e: E;
|
||||
@ -42,10 +43,12 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co
|
||||
class F {
|
||||
y: number;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'y'.
|
||||
!!! error TS2686: 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.
|
||||
}
|
||||
|
||||
var f: F;
|
||||
|
||||
@ -4,12 +4,10 @@ tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompa
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(11,5): error TS2412: Property ''1'' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(15,5): error TS2411: Property 'foo' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(19,5): error TS2411: Property 'foo' of type '() => { x: number; }' is not assignable to string index type '{ x: number; }'.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(24,5): error TS2300: Duplicate identifier '1'.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(24,5): error TS2412: Property '1' of type '{ x: number; }' is not assignable to numeric index type '{ x: number; y: number; }'.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(28,5): error TS2300: Duplicate identifier ''1''.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts (9 errors) ====
|
||||
==== tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts (7 errors) ====
|
||||
interface Base {
|
||||
[x: number]: { x: number; y: number; };
|
||||
[x: string]: { x: number; }
|
||||
@ -46,14 +44,10 @@ tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompa
|
||||
// satisifies string indexer but not numeric indexer
|
||||
interface Derived5 extends Base {
|
||||
1: { x: number } // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2412: Property '1' of type '{ x: number; }' is not assignable to numeric index type '{ x: number; y: number; }'.
|
||||
}
|
||||
|
||||
interface Derived5 extends Base {
|
||||
'1': { x: number } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier ''1''.
|
||||
}
|
||||
@ -1,4 +1,3 @@
|
||||
tests/cases/compiler/duplicateClassElements.ts(2,12): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(3,12): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(4,12): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/duplicateClassElements.ts(6,12): error TS2393: Duplicate function implementation.
|
||||
@ -15,10 +14,9 @@ tests/cases/compiler/duplicateClassElements.ts(23,9): error TS2300: Duplicate id
|
||||
tests/cases/compiler/duplicateClassElements.ts(26,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/duplicateClassElements.ts(26,9): error TS2300: Duplicate identifier 'z'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(29,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/duplicateClassElements.ts(29,9): error TS2300: Duplicate identifier 'x2'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(32,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/duplicateClassElements.ts(32,9): error TS2300: Duplicate identifier 'x2'.
|
||||
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(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.
|
||||
@ -26,11 +24,9 @@ tests/cases/compiler/duplicateClassElements.ts(39,9): error TS2300: Duplicate id
|
||||
tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate identifier 'z2'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateClassElements.ts (26 errors) ====
|
||||
==== tests/cases/compiler/duplicateClassElements.ts (24 errors) ====
|
||||
class a {
|
||||
public a;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
public a;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
@ -90,19 +86,17 @@ tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate i
|
||||
get x2() {
|
||||
~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'x2'.
|
||||
return 10;
|
||||
}
|
||||
set x2(_x: number) {
|
||||
~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'x2'.
|
||||
}
|
||||
public x2;
|
||||
~~
|
||||
!!! 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'.
|
||||
|
||||
get z2() {
|
||||
~~
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
tests/cases/compiler/duplicateIdentifierComputedName.ts(3,5): error TS2300: Duplicate identifier 'a'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateIdentifierComputedName.ts (1 errors) ====
|
||||
class C {
|
||||
["a"]: string;
|
||||
["a"]: string;
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
}
|
||||
|
||||
13
tests/baselines/reference/duplicateIdentifierComputedName.js
Normal file
13
tests/baselines/reference/duplicateIdentifierComputedName.js
Normal file
@ -0,0 +1,13 @@
|
||||
//// [duplicateIdentifierComputedName.ts]
|
||||
class C {
|
||||
["a"]: string;
|
||||
["a"]: string;
|
||||
}
|
||||
|
||||
|
||||
//// [duplicateIdentifierComputedName.js]
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
}());
|
||||
@ -0,0 +1,37 @@
|
||||
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 (4 errors) ====
|
||||
// Not OK
|
||||
interface B { x; }
|
||||
~
|
||||
!!! error TS2686: All declarations of 'x' must have identical modifiers.
|
||||
interface B { x?; }
|
||||
~
|
||||
!!! error TS2686: All declarations of 'x' must have identical modifiers.
|
||||
|
||||
// OK
|
||||
class A {
|
||||
public y: string;
|
||||
}
|
||||
|
||||
interface A {
|
||||
y: string;
|
||||
}
|
||||
|
||||
// Not OK
|
||||
class C {
|
||||
private y: string;
|
||||
~
|
||||
!!! error TS2686: All declarations of 'y' must have identical modifiers.
|
||||
}
|
||||
|
||||
interface C {
|
||||
y: string;
|
||||
~
|
||||
!!! error TS2686: All declarations of 'y' must have identical modifiers.
|
||||
}
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
//// [duplicateIdentifierDifferentModifiers.ts]
|
||||
// Not OK
|
||||
interface B { x; }
|
||||
interface B { x?; }
|
||||
|
||||
// OK
|
||||
class A {
|
||||
public y: string;
|
||||
}
|
||||
|
||||
interface A {
|
||||
y: string;
|
||||
}
|
||||
|
||||
// Not OK
|
||||
class C {
|
||||
private y: string;
|
||||
}
|
||||
|
||||
interface C {
|
||||
y: string;
|
||||
}
|
||||
|
||||
|
||||
//// [duplicateIdentifierDifferentModifiers.js]
|
||||
// OK
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
return A;
|
||||
}());
|
||||
// Not OK
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
}());
|
||||
@ -0,0 +1,16 @@
|
||||
tests/cases/compiler/duplicateIdentifierDifferentSpelling.ts(3,3): error TS2300: Duplicate identifier '3'.
|
||||
tests/cases/compiler/duplicateIdentifierDifferentSpelling.ts(6,21): error TS2300: Duplicate identifier '3'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateIdentifierDifferentSpelling.ts (2 errors) ====
|
||||
class A {
|
||||
0b11 = '';
|
||||
3 = '';
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '3'.
|
||||
}
|
||||
|
||||
var X = { 0b11: '', 3: '' };
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '3'.
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
//// [duplicateIdentifierDifferentSpelling.ts]
|
||||
class A {
|
||||
0b11 = '';
|
||||
3 = '';
|
||||
}
|
||||
|
||||
var X = { 0b11: '', 3: '' };
|
||||
|
||||
|
||||
//// [duplicateIdentifierDifferentSpelling.js]
|
||||
var A = (function () {
|
||||
function A() {
|
||||
this[3] = '';
|
||||
this[3] = '';
|
||||
}
|
||||
return A;
|
||||
}());
|
||||
var X = { 3: '', 3: '' };
|
||||
@ -1,8 +1,6 @@
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(2,5): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(4,5): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(5,5): error TS2300: Duplicate identifier '\u0061'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(6,5): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(7,9): error TS2300: Duplicate identifier 'c'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(8,9): error TS2300: Duplicate identifier '"c"'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(14,9): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(15,9): error TS2300: Duplicate identifier 'a'.
|
||||
@ -10,11 +8,9 @@ tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS1118: An o
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS2300: Duplicate identifier 'a'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateObjectLiteralProperty.ts (10 errors) ====
|
||||
==== tests/cases/compiler/duplicateObjectLiteralProperty.ts (8 errors) ====
|
||||
var x = {
|
||||
a: 1,
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
b: true, // OK
|
||||
a: 56, // Duplicate
|
||||
~
|
||||
@ -26,8 +22,6 @@ tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS2300: Dupl
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
c: 1,
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'c'.
|
||||
"c": 56, // Duplicate
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '"c"'.
|
||||
|
||||
@ -1,14 +1,11 @@
|
||||
tests/cases/compiler/duplicatePropertiesInStrictMode.ts(3,3): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/compiler/duplicatePropertiesInStrictMode.ts(4,3): error TS1117: An object literal cannot have multiple properties with the same name in strict mode.
|
||||
tests/cases/compiler/duplicatePropertiesInStrictMode.ts(4,3): error TS2300: Duplicate identifier 'x'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicatePropertiesInStrictMode.ts (3 errors) ====
|
||||
==== tests/cases/compiler/duplicatePropertiesInStrictMode.ts (2 errors) ====
|
||||
"use strict";
|
||||
var x = {
|
||||
x: 1,
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
x: 2
|
||||
~
|
||||
!!! error TS1117: An object literal cannot have multiple properties with the same name in strict mode.
|
||||
|
||||
@ -2,11 +2,9 @@ tests/cases/conformance/types/members/duplicatePropertyNames.ts(4,5): error TS23
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(5,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(14,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(15,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(19,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(20,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(22,5): error TS2393: Duplicate function implementation.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(23,5): error TS2393: Duplicate function implementation.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(25,5): error TS2300: Duplicate identifier 'baz'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(26,5): error TS2300: Duplicate identifier 'baz'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(30,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(31,5): error TS2300: Duplicate identifier 'foo'.
|
||||
@ -14,13 +12,11 @@ tests/cases/conformance/types/members/duplicatePropertyNames.ts(35,5): error TS2
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(36,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(38,5): error TS2300: Duplicate identifier 'bar'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(39,5): error TS2300: Duplicate identifier 'bar'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(43,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(44,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(45,5): error TS2300: Duplicate identifier 'bar'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(46,5): error TS2300: Duplicate identifier 'bar'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/members/duplicatePropertyNames.ts (20 errors) ====
|
||||
==== tests/cases/conformance/types/members/duplicatePropertyNames.ts (16 errors) ====
|
||||
// duplicate property names are an error in all types
|
||||
|
||||
interface Number {
|
||||
@ -48,8 +44,6 @@ tests/cases/conformance/types/members/duplicatePropertyNames.ts(46,5): error TS2
|
||||
|
||||
class C {
|
||||
foo: string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
foo: string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
@ -62,8 +56,6 @@ tests/cases/conformance/types/members/duplicatePropertyNames.ts(46,5): error TS2
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
|
||||
baz = () => { }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'baz'.
|
||||
baz = () => { }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'baz'.
|
||||
@ -96,14 +88,10 @@ tests/cases/conformance/types/members/duplicatePropertyNames.ts(46,5): error TS2
|
||||
|
||||
var b = {
|
||||
foo: '',
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
foo: '',
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
bar: () => { },
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'bar'.
|
||||
bar: () => { }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'bar'.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/duplicateStringNamedProperty1.ts(2,5): error TS2300: Duplicate identifier '"artist"'.
|
||||
tests/cases/compiler/duplicateStringNamedProperty1.ts(2,5): error TS2300: Duplicate identifier 'artist'.
|
||||
tests/cases/compiler/duplicateStringNamedProperty1.ts(3,5): error TS2300: Duplicate identifier 'artist'.
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ tests/cases/compiler/duplicateStringNamedProperty1.ts(3,5): error TS2300: Duplic
|
||||
export interface Album {
|
||||
"artist": string;
|
||||
~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier '"artist"'.
|
||||
!!! error TS2300: Duplicate identifier 'artist'.
|
||||
artist: string;
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'artist'.
|
||||
|
||||
@ -1,8 +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(2,16): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/gettersAndSettersErrors.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/gettersAndSettersErrors.ts(3,16): error TS2300: Duplicate identifier 'Foo'.
|
||||
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(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.
|
||||
@ -11,22 +10,20 @@ tests/cases/compiler/gettersAndSettersErrors.ts(12,16): error TS1056: Accessors
|
||||
tests/cases/compiler/gettersAndSettersErrors.ts(12,16): error TS2379: Getter and setter accessors do not agree in visibility.
|
||||
|
||||
|
||||
==== tests/cases/compiler/gettersAndSettersErrors.ts (11 errors) ====
|
||||
==== tests/cases/compiler/gettersAndSettersErrors.ts (10 errors) ====
|
||||
class C {
|
||||
public get Foo() { return "foo";} // ok
|
||||
~~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
public set Foo(foo:string) {} // ok
|
||||
~~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
|
||||
public Foo = 0; // error - duplicate identifier Foo - confirmed
|
||||
~~~
|
||||
!!! 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'.
|
||||
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.
|
||||
|
||||
@ -2,6 +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(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'.
|
||||
@ -10,7 +11,7 @@ tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i
|
||||
Named property 'foo' of types 'i10' and 'i11' are not identical.
|
||||
|
||||
|
||||
==== tests/cases/compiler/interfaceDeclaration1.ts (8 errors) ====
|
||||
==== tests/cases/compiler/interfaceDeclaration1.ts (9 errors) ====
|
||||
interface I1 {
|
||||
item:number;
|
||||
~~~~
|
||||
@ -27,6 +28,8 @@ tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i
|
||||
item:number;
|
||||
~~~~
|
||||
!!! 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'.
|
||||
}
|
||||
|
||||
interface I3 {
|
||||
|
||||
@ -1,15 +1,9 @@
|
||||
tests/cases/compiler/a.js(1,22): error TS2528: A module cannot have multiple default exports.
|
||||
tests/cases/compiler/a.js(3,1): error TS2528: A module cannot have multiple default exports.
|
||||
tests/cases/compiler/a.js(3,16): error TS1109: Expression expected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/a.js (3 errors) ====
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
export default class a {
|
||||
~
|
||||
!!! error TS2528: A module cannot have multiple default exports.
|
||||
}
|
||||
export default var a = 10;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2528: A module cannot have multiple default exports.
|
||||
~~~
|
||||
!!! error TS1109: Expression expected.
|
||||
@ -1,6 +1,4 @@
|
||||
tests/cases/compiler/a.js(3,5): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/a.js(5,5): error TS1117: An object literal cannot have multiple properties with the same name in strict mode.
|
||||
tests/cases/compiler/a.js(5,5): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/a.js(7,5): error TS1212: Identifier expected. 'let' is a reserved word in strict mode
|
||||
tests/cases/compiler/a.js(8,8): error TS1102: 'delete' cannot be called on an identifier in strict mode.
|
||||
tests/cases/compiler/a.js(10,10): error TS1100: Invalid use of 'eval' in strict mode.
|
||||
@ -14,18 +12,14 @@ tests/cases/compiler/d.js(2,9): error TS1121: Octal literals are not allowed in
|
||||
tests/cases/compiler/d.js(2,11): error TS1005: ',' expected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/a.js (8 errors) ====
|
||||
==== tests/cases/compiler/a.js (6 errors) ====
|
||||
"use strict";
|
||||
var a = {
|
||||
a: "hello", // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
b: 10,
|
||||
a: 10 // error
|
||||
~
|
||||
!!! error TS1117: An object literal cannot have multiple properties with the same name in strict mode.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
};
|
||||
var let = 10; // error
|
||||
~~~
|
||||
|
||||
@ -3,13 +3,11 @@ tests/cases/compiler/lastPropertyInLiteralWins.ts(7,6): error TS2345: Argument o
|
||||
Type '(num: number) => void' is not assignable to type '(str: string) => void'.
|
||||
Types of parameters 'num' and 'str' are incompatible.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/compiler/lastPropertyInLiteralWins.ts(8,5): error TS2300: Duplicate identifier 'thunk'.
|
||||
tests/cases/compiler/lastPropertyInLiteralWins.ts(9,5): error TS2300: Duplicate identifier 'thunk'.
|
||||
tests/cases/compiler/lastPropertyInLiteralWins.ts(13,5): error TS2300: Duplicate identifier 'thunk'.
|
||||
tests/cases/compiler/lastPropertyInLiteralWins.ts(14,5): error TS2300: Duplicate identifier 'thunk'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/lastPropertyInLiteralWins.ts (5 errors) ====
|
||||
==== tests/cases/compiler/lastPropertyInLiteralWins.ts (3 errors) ====
|
||||
interface Thing {
|
||||
thunk: (str: string) => void;
|
||||
}
|
||||
@ -20,8 +18,6 @@ tests/cases/compiler/lastPropertyInLiteralWins.ts(14,5): error TS2300: Duplicate
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
thunk: (str: string) => {},
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'thunk'.
|
||||
thunk: (num: number) => {}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
@ -36,8 +32,6 @@ tests/cases/compiler/lastPropertyInLiteralWins.ts(14,5): error TS2300: Duplicate
|
||||
|
||||
test({ // Should be OK. Last 'thunk' is of correct type
|
||||
thunk: (num: number) => {},
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'thunk'.
|
||||
thunk: (str: string) => {}
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'thunk'.
|
||||
|
||||
@ -1,14 +1,11 @@
|
||||
tests/cases/compiler/memberOverride.ts(4,5): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/memberOverride.ts(5,5): error TS2300: Duplicate identifier 'a'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/memberOverride.ts (2 errors) ====
|
||||
==== tests/cases/compiler/memberOverride.ts (1 errors) ====
|
||||
// An object initialiser accepts the first definition for the same property with a different type signature
|
||||
// Should compile, since the second declaration of a overrides the first
|
||||
var x = {
|
||||
a: "",
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
a: 5
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
|
||||
@ -1,35 +1,28 @@
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(2,5): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(6,5): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(11,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(15,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(33,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(39,9): error TS2300: Duplicate identifier 'x'.
|
||||
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 errors) ====
|
||||
==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts (3 errors) ====
|
||||
interface A {
|
||||
x: string; // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
}
|
||||
|
||||
interface A {
|
||||
x: number;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'.
|
||||
}
|
||||
|
||||
module M {
|
||||
interface A<T> {
|
||||
x: T;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
}
|
||||
|
||||
interface A<T> {
|
||||
x: number; // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'T', but here has type 'number'.
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,8 +41,6 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli
|
||||
module M3 {
|
||||
export interface A<T> {
|
||||
x: T;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,6 +48,6 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli
|
||||
export interface A<T> {
|
||||
x: number; // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'T', but here has type 'number'.
|
||||
}
|
||||
}
|
||||
@ -1,62 +0,0 @@
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts(2,5): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts(6,5): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts(11,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts(15,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts(33,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts(39,9): error TS2300: Duplicate identifier 'x'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts (6 errors) ====
|
||||
interface A {
|
||||
x: string; // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
}
|
||||
|
||||
interface A {
|
||||
x: string; // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
}
|
||||
|
||||
module M {
|
||||
interface A<T> {
|
||||
x: T;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
}
|
||||
|
||||
interface A<T> {
|
||||
x: T; // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
}
|
||||
}
|
||||
|
||||
module M2 {
|
||||
interface A<T> {
|
||||
x: T;
|
||||
}
|
||||
}
|
||||
|
||||
module M2 {
|
||||
interface A<T> {
|
||||
x: T; // ok, different declaration space than other M2
|
||||
}
|
||||
}
|
||||
|
||||
module M3 {
|
||||
export interface A<T> {
|
||||
x: T;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
}
|
||||
}
|
||||
|
||||
module M3 {
|
||||
export interface A<T> {
|
||||
x: T; // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts ===
|
||||
interface A {
|
||||
>A : Symbol(A, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 0, 0), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 2, 1))
|
||||
|
||||
x: string; // error
|
||||
>x : Symbol(A.x, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 0, 13), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 4, 13))
|
||||
}
|
||||
|
||||
interface A {
|
||||
>A : Symbol(A, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 0, 0), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 2, 1))
|
||||
|
||||
x: string; // error
|
||||
>x : Symbol(A.x, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 0, 13), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 4, 13))
|
||||
}
|
||||
|
||||
module M {
|
||||
>M : Symbol(M, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 6, 1))
|
||||
|
||||
interface A<T> {
|
||||
>A : Symbol(A, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 8, 10), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 11, 5))
|
||||
>T : Symbol(T, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 9, 16), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 13, 16))
|
||||
|
||||
x: T;
|
||||
>x : Symbol(A.x, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 9, 20), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 13, 20))
|
||||
>T : Symbol(T, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 9, 16), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 13, 16))
|
||||
}
|
||||
|
||||
interface A<T> {
|
||||
>A : Symbol(A, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 8, 10), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 11, 5))
|
||||
>T : Symbol(T, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 9, 16), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 13, 16))
|
||||
|
||||
x: T; // error
|
||||
>x : Symbol(A.x, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 9, 20), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 13, 20))
|
||||
>T : Symbol(T, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 9, 16), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 13, 16))
|
||||
}
|
||||
}
|
||||
|
||||
module M2 {
|
||||
>M2 : Symbol(M2, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 16, 1), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 22, 1))
|
||||
|
||||
interface A<T> {
|
||||
>A : Symbol(A, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 18, 11))
|
||||
>T : Symbol(T, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 19, 16))
|
||||
|
||||
x: T;
|
||||
>x : Symbol(A.x, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 19, 20))
|
||||
>T : Symbol(T, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 19, 16))
|
||||
}
|
||||
}
|
||||
|
||||
module M2 {
|
||||
>M2 : Symbol(M2, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 16, 1), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 22, 1))
|
||||
|
||||
interface A<T> {
|
||||
>A : Symbol(A, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 24, 11))
|
||||
>T : Symbol(T, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 25, 16))
|
||||
|
||||
x: T; // ok, different declaration space than other M2
|
||||
>x : Symbol(A.x, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 25, 20))
|
||||
>T : Symbol(T, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 25, 16))
|
||||
}
|
||||
}
|
||||
|
||||
module M3 {
|
||||
>M3 : Symbol(M3, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 28, 1), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 34, 1))
|
||||
|
||||
export interface A<T> {
|
||||
>A : Symbol(A, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 30, 11), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 36, 11))
|
||||
>T : Symbol(T, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 31, 23), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 37, 23))
|
||||
|
||||
x: T;
|
||||
>x : Symbol(A.x, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 31, 27), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 37, 27))
|
||||
>T : Symbol(T, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 31, 23), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 37, 23))
|
||||
}
|
||||
}
|
||||
|
||||
module M3 {
|
||||
>M3 : Symbol(M3, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 28, 1), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 34, 1))
|
||||
|
||||
export interface A<T> {
|
||||
>A : Symbol(A, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 30, 11), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 36, 11))
|
||||
>T : Symbol(T, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 31, 23), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 37, 23))
|
||||
|
||||
x: T; // error
|
||||
>x : Symbol(A.x, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 31, 27), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 37, 27))
|
||||
>T : Symbol(T, Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 31, 23), Decl(mergedInterfacesWithConflictingPropertyNames2.ts, 37, 23))
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts ===
|
||||
interface A {
|
||||
>A : A
|
||||
|
||||
x: string; // error
|
||||
>x : string
|
||||
}
|
||||
|
||||
interface A {
|
||||
>A : A
|
||||
|
||||
x: string; // error
|
||||
>x : string
|
||||
}
|
||||
|
||||
module M {
|
||||
>M : any
|
||||
|
||||
interface A<T> {
|
||||
>A : A<T>
|
||||
>T : T
|
||||
|
||||
x: T;
|
||||
>x : T
|
||||
>T : T
|
||||
}
|
||||
|
||||
interface A<T> {
|
||||
>A : A<T>
|
||||
>T : T
|
||||
|
||||
x: T; // error
|
||||
>x : T
|
||||
>T : T
|
||||
}
|
||||
}
|
||||
|
||||
module M2 {
|
||||
>M2 : any
|
||||
|
||||
interface A<T> {
|
||||
>A : A<T>
|
||||
>T : T
|
||||
|
||||
x: T;
|
||||
>x : T
|
||||
>T : T
|
||||
}
|
||||
}
|
||||
|
||||
module M2 {
|
||||
>M2 : any
|
||||
|
||||
interface A<T> {
|
||||
>A : A<T>
|
||||
>T : T
|
||||
|
||||
x: T; // ok, different declaration space than other M2
|
||||
>x : T
|
||||
>T : T
|
||||
}
|
||||
}
|
||||
|
||||
module M3 {
|
||||
>M3 : any
|
||||
|
||||
export interface A<T> {
|
||||
>A : A<T>
|
||||
>T : T
|
||||
|
||||
x: T;
|
||||
>x : T
|
||||
>T : T
|
||||
}
|
||||
}
|
||||
|
||||
module M3 {
|
||||
>M3 : any
|
||||
|
||||
export interface A<T> {
|
||||
>A : A<T>
|
||||
>T : T
|
||||
|
||||
x: T; // error
|
||||
>x : T
|
||||
>T : T
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,16 @@
|
||||
tests/cases/conformance/es6/modules/m1.ts(2,22): error TS2323: Cannot redeclare exported variable 'default'.
|
||||
tests/cases/conformance/es6/modules/m1.ts(2,22): error TS2528: A module cannot have multiple default exports.
|
||||
tests/cases/conformance/es6/modules/m1.ts(6,25): error TS2528: A module cannot have multiple default exports.
|
||||
tests/cases/conformance/es6/modules/m1.ts(11,1): error TS2528: A module cannot have multiple default exports.
|
||||
tests/cases/conformance/es6/modules/m1.ts(11,1): error TS2323: Cannot redeclare exported variable 'default'.
|
||||
tests/cases/conformance/es6/modules/m2.ts(3,1): error TS2348: Value of type 'typeof foo' is not callable. Did you mean to include 'new'?
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m1.ts (3 errors) ====
|
||||
==== tests/cases/conformance/es6/modules/m1.ts (4 errors) ====
|
||||
|
||||
export default class foo {
|
||||
~~~
|
||||
!!! error TS2323: Cannot redeclare exported variable 'default'.
|
||||
~~~
|
||||
!!! error TS2528: A module cannot have multiple default exports.
|
||||
|
||||
}
|
||||
@ -21,7 +24,7 @@ tests/cases/conformance/es6/modules/m2.ts(3,1): error TS2348: Value of type 'typ
|
||||
var x = 10;
|
||||
export default x;
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2528: A module cannot have multiple default exports.
|
||||
!!! error TS2323: Cannot redeclare exported variable 'default'.
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m2.ts (1 errors) ====
|
||||
import Entity from "./m1"
|
||||
|
||||
@ -1,26 +1,20 @@
|
||||
tests/cases/compiler/numericClassMembers1.ts(2,3): error TS2300: Duplicate identifier '0'.
|
||||
tests/cases/compiler/numericClassMembers1.ts(3,3): error TS2300: Duplicate identifier '0.0'.
|
||||
tests/cases/compiler/numericClassMembers1.ts(7,3): error TS2300: Duplicate identifier '0.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'.
|
||||
tests/cases/compiler/numericClassMembers1.ts(8,2): error TS2300: Duplicate identifier '0'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/numericClassMembers1.ts (4 errors) ====
|
||||
==== tests/cases/compiler/numericClassMembers1.ts (2 errors) ====
|
||||
class C234 {
|
||||
0 = 1;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '0'.
|
||||
0.0 = 2;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '0.0'.
|
||||
!!! error TS2300: Duplicate identifier '0'.
|
||||
}
|
||||
|
||||
class C235 {
|
||||
0.0 = 1;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '0.0'.
|
||||
'0' = 2;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier ''0''.
|
||||
!!! error TS2300: Duplicate identifier '0'.
|
||||
}
|
||||
|
||||
class C236 {
|
||||
|
||||
@ -1,27 +1,19 @@
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(2,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(4,12): error TS2300: Duplicate identifier '2'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(3,5): error TS2300: Duplicate identifier '1'.
|
||||
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.'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(10,5): error TS2300: Duplicate identifier '2'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(14,5): error TS2300: Duplicate identifier '1'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(15,5): error TS2300: Duplicate identifier '1'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(19,5): error TS2300: Duplicate identifier '2'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(20,5): error TS1005: ',' expected.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(20,5): error TS2300: Duplicate identifier '2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts (11 errors) ====
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts (7 errors) ====
|
||||
class C {
|
||||
1: number;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
1.0: number;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '1.0'.
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
static 2: number;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '2'.
|
||||
static 2: number;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '2'.
|
||||
@ -33,7 +25,7 @@ tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedP
|
||||
!!! error TS2300: Duplicate identifier '2'.
|
||||
2.: number;
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier '2.'.
|
||||
!!! error TS2300: Duplicate identifier '2'.
|
||||
}
|
||||
|
||||
var a: {
|
||||
@ -47,11 +39,7 @@ tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedP
|
||||
|
||||
var b = {
|
||||
2: 1
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '2'.
|
||||
2: 1
|
||||
~
|
||||
!!! error TS1005: ',' expected.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '2'.
|
||||
}
|
||||
@ -1,30 +1,27 @@
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(4,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(6,5): error TS2300: Duplicate identifier '1'.
|
||||
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"'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(17,5): error TS2300: Duplicate identifier '1.0'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(21,5): error TS2300: Duplicate identifier '"0"'.
|
||||
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(22,5): error TS2300: Duplicate identifier '0'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts (8 errors) ====
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts (7 errors) ====
|
||||
// Each of these types has an error in it.
|
||||
// String named and numeric named properties conflict if they would be equivalent after ToNumber on the property name.
|
||||
class C {
|
||||
"1": number;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '"1"'.
|
||||
"1.0": number; // not a duplicate
|
||||
1.0: number;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '1.0'.
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
}
|
||||
|
||||
interface I {
|
||||
"1": number;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '"1"'.
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
"1.": number; // not a duplicate
|
||||
1: number;
|
||||
~
|
||||
@ -34,16 +31,16 @@ tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericString
|
||||
var a: {
|
||||
"1": number;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '"1"'.
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
1.0: string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '1.0'.
|
||||
!!! 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'.
|
||||
}
|
||||
|
||||
var b = {
|
||||
"0": '',
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '"0"'.
|
||||
0: ''
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '0'.
|
||||
|
||||
@ -1,39 +1,21 @@
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(3,12): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(3,18): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(4,12): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(4,19): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(5,12): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(5,18): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(6,12): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(6,21): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(7,12): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(7,19): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(8,12): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(8,18): error TS2300: Duplicate identifier ''a''.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(9,12): error TS2300: Duplicate identifier ''a''.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(9,20): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(10,12): error TS2300: Duplicate identifier ''a''.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(10,20): error TS2300: Duplicate identifier '"a"'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(11,12): error TS2300: Duplicate identifier ''a''.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(11,20): error TS2300: Duplicate identifier ''a''.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(12,13): error TS2300: Duplicate identifier '"a"'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(12,21): error TS2300: Duplicate identifier ''a''.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(13,13): error TS2300: Duplicate identifier '1.0'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(13,21): error TS2300: Duplicate identifier ''1''.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(14,13): error TS2300: Duplicate identifier '0'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(14,19): error TS2300: Duplicate identifier '0'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(15,13): error TS2300: Duplicate identifier '0'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(15,19): error TS2300: Duplicate identifier '0'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,13): error TS2300: Duplicate identifier '0'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,19): error TS2300: Duplicate identifier '0x0'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,13): error TS2300: Duplicate identifier '0'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,19): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,19): error TS2300: Duplicate identifier '000'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(18,13): error TS2300: Duplicate identifier '"100"'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(18,23): error TS2300: Duplicate identifier '1e2'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(19,13): error TS2300: Duplicate identifier '0x20'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(19,22): error TS2300: Duplicate identifier '3.2e1'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(20,13): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(20,25): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,12): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,22): error TS1119: An object literal cannot have property and accessor with the same name.
|
||||
@ -96,99 +78,63 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,16)
|
||||
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,55): error TS2380: 'get' and 'set' accessor must have the same type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (96 errors) ====
|
||||
==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (78 errors) ====
|
||||
|
||||
// Multiple properties with the same name
|
||||
var e1 = { a: 0, a: 0 };
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
var e2 = { a: '', a: '' };
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
var e3 = { a: 0, a: '' };
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
var e4 = { a: true, a: false };
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
var e5 = { a: {}, a: {} };
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
var e6 = { a: 0, 'a': 0 };
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier ''a''.
|
||||
var e7 = { 'a': 0, a: 0 };
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier ''a''.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
var e8 = { 'a': 0, "a": 0 };
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier ''a''.
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '"a"'.
|
||||
var e9 = { 'a': 0, 'a': 0 };
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier ''a''.
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier ''a''.
|
||||
var e10 = { "a": 0, 'a': 0 };
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '"a"'.
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier ''a''.
|
||||
var e11 = { 1.0: 0, '1': 0 };
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '1.0'.
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier ''1''.
|
||||
var e12 = { 0: 0, 0: 0 };
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '0'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '0'.
|
||||
var e13 = { 0: 0, 0: 0 };
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '0'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '0'.
|
||||
var e14 = { 0: 0, 0x0: 0 };
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '0'.
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '0x0'.
|
||||
var e14 = { 0: 0, 000: 0 };
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '0'.
|
||||
~~~
|
||||
!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher.
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '000'.
|
||||
var e15 = { "100": 0, 1e2: 0 };
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier '"100"'.
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '1e2'.
|
||||
var e16 = { 0x20: 0, 3.2e1: 0 };
|
||||
~~~~
|
||||
!!! error TS2300: Duplicate identifier '0x20'.
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier '3.2e1'.
|
||||
var e17 = { a: 0, b: 1, a: 0 };
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
|
||||
|
||||
@ -7,16 +7,13 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(9,8): error TS1005: ':' expected.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(10,10): error TS1005: ':' expected.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(12,1): error TS1005: ':' expected.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,5): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,6): error TS1005: ':' expected.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,5): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,6): error TS1005: ':' expected.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,5): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,6): error TS1005: ':' expected.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(20,17): error TS1005: ':' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts (16 errors) ====
|
||||
==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts (13 errors) ====
|
||||
// errors
|
||||
var y = {
|
||||
"stringLiteral",
|
||||
@ -50,18 +47,12 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr
|
||||
|
||||
var x = {
|
||||
a.b,
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS1005: ':' expected.
|
||||
a["ss"],
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS1005: ':' expected.
|
||||
a[1],
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS1005: ':' expected.
|
||||
};
|
||||
|
||||
@ -1,38 +1,34 @@
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(5,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(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(12,5): error TS2300: Duplicate identifier '1'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(13,5): error TS2300: Duplicate identifier '1.0'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(14,5): error TS2300: Duplicate identifier '1.'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(15,5): error TS2300: Duplicate identifier '1.00'.
|
||||
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'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(15,5): error TS2300: Duplicate identifier '1'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(19,5): error TS2300: Duplicate identifier '1'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(20,5): error TS2300: Duplicate identifier '1.0'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(21,5): error TS2300: Duplicate identifier '1.'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(22,5): error TS2300: Duplicate identifier '1.00'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(26,5): error TS2300: Duplicate identifier '1'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(20,5): error TS2300: Duplicate identifier '1'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(21,5): error TS2300: Duplicate identifier '1'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(22,5): error TS2300: Duplicate identifier '1'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(27,5): error TS2300: Duplicate identifier '1.0'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(28,5): error TS2300: Duplicate identifier '1.'.
|
||||
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(29,5): error TS2300: Duplicate identifier '1.00'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts (16 errors) ====
|
||||
==== tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts (14 errors) ====
|
||||
// numeric properties must be distinct after a ToNumber operation
|
||||
// so the below are all errors
|
||||
|
||||
class C {
|
||||
1;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
1.0;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '1.0'.
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
1.;
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier '1.'.
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
1.00;
|
||||
~~~~
|
||||
!!! error TS2300: Duplicate identifier '1.00'.
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
}
|
||||
|
||||
interface I {
|
||||
@ -41,13 +37,13 @@ tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
1.0;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '1.0'.
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
1.;
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier '1.'.
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
1.00;
|
||||
~~~~
|
||||
!!! error TS2300: Duplicate identifier '1.00'.
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
}
|
||||
|
||||
var a: {
|
||||
@ -56,19 +52,17 @@ tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
1.0;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '1.0'.
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
1.;
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier '1.'.
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
1.00;
|
||||
~~~~
|
||||
!!! error TS2300: Duplicate identifier '1.00'.
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
}
|
||||
|
||||
var b = {
|
||||
1: 1,
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
1.0: 1,
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '1.0'.
|
||||
|
||||
@ -1,11 +1,8 @@
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts(2,19): error TS1005: ',' expected.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts(3,18): error TS1005: ',' expected.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts(6,5): error TS2300: Duplicate identifier '0O45436'.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts(7,5): error TS2300: Duplicate identifier '19230'.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts(8,5): error TS2300: Duplicate identifier '"19230"'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts (5 errors) ====
|
||||
==== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts (2 errors) ====
|
||||
// error
|
||||
var oct1 = 0O13334823;
|
||||
~~~
|
||||
@ -16,13 +13,7 @@ tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralErro
|
||||
|
||||
var obj1 = {
|
||||
0O45436: "hi",
|
||||
~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier '0O45436'.
|
||||
19230: "Hello",
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier '19230'.
|
||||
"19230": "world",
|
||||
~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier '"19230"'.
|
||||
};
|
||||
|
||||
@ -5,7 +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(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(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.
|
||||
@ -14,7 +16,7 @@ tests/cases/compiler/optionalPropertiesSyntax.ts(33,7): error TS2375: Duplicate
|
||||
tests/cases/compiler/optionalPropertiesSyntax.ts(34,5): error TS2375: Duplicate number index signature.
|
||||
|
||||
|
||||
==== tests/cases/compiler/optionalPropertiesSyntax.ts (14 errors) ====
|
||||
==== tests/cases/compiler/optionalPropertiesSyntax.ts (16 errors) ====
|
||||
interface fnSigs {
|
||||
//functions signatures can be optional
|
||||
fn(): void;
|
||||
@ -53,9 +55,13 @@ tests/cases/compiler/optionalPropertiesSyntax.ts(34,5): error TS2375: Duplicate
|
||||
prop: any;
|
||||
~~~~
|
||||
!!! error TS2300: Duplicate identifier 'prop'.
|
||||
~~~~
|
||||
!!! error TS2686: 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.
|
||||
prop2?: any;
|
||||
}
|
||||
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
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(3,24): error TS2300: Duplicate identifier 'names'.
|
||||
tests/cases/compiler/parameterPropertyInConstructor2.ts(4,24): error TS2300: Duplicate identifier 'names'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/parameterPropertyInConstructor2.ts (4 errors) ====
|
||||
==== tests/cases/compiler/parameterPropertyInConstructor2.ts (2 errors) ====
|
||||
module mod {
|
||||
class Customers {
|
||||
constructor(public names: string);
|
||||
@ -12,11 +10,7 @@ tests/cases/compiler/parameterPropertyInConstructor2.ts(4,24): error TS2300: Dup
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'names'.
|
||||
constructor(public names: string, public ages: number) {
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'names'.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,28): error TS2304: Cannot find name 'DisplayPosition'.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,45): error TS1137: Expression or comma expected.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,46): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,48): error TS2300: Duplicate identifier '3'.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,49): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,51): error TS2300: Duplicate identifier '3'.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,52): error TS1005: ';' expected.
|
||||
@ -11,7 +10,6 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,57): error T
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,58): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,60): error TS2300: Duplicate identifier '3'.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,61): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,63): error TS2300: Duplicate identifier '0'.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,64): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,66): error TS2300: Duplicate identifier '3'.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,67): error TS1005: ';' expected.
|
||||
@ -34,7 +32,7 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,97): error T
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error TS2304: Cannot find name 'SeedCoords'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts (34 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts (32 errors) ====
|
||||
export class Game {
|
||||
private position = new DisplayPosition([), 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3, 0], NoMove, 0);
|
||||
~~~~~~~~~~~~~~~
|
||||
@ -43,8 +41,6 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error T
|
||||
!!! error TS1137: Expression or comma expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '3'.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
@ -63,8 +59,6 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error T
|
||||
!!! error TS2300: Duplicate identifier '3'.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '0'.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts(1,11): error TS1042: 'public' modifier cannot be used here.
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts(1,22): error TS2378: A 'get' accessor must return a value.
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts(1,23): error TS2304: Cannot find name 'e'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts (3 errors) ====
|
||||
var v = { public get [e]() { } };
|
||||
~~~~~~
|
||||
!!! error TS1042: 'public' modifier cannot be used here.
|
||||
~~~
|
||||
!!! error TS2378: A 'get' accessor must return a value.
|
||||
~
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/propertyNamedPrototype.ts(3,12): error TS2300: Duplicate identifier 'prototype'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/propertyMemberDeclarations/propertyNamedPrototype.ts (1 errors) ====
|
||||
class C {
|
||||
prototype: number; // ok
|
||||
static prototype: C; // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'prototype'.
|
||||
}
|
||||
11
tests/baselines/reference/propertyNamedPrototype.symbols
Normal file
11
tests/baselines/reference/propertyNamedPrototype.symbols
Normal file
@ -0,0 +1,11 @@
|
||||
=== tests/cases/conformance/classes/propertyMemberDeclarations/propertyNamedPrototype.ts ===
|
||||
class C {
|
||||
>C : Symbol(C, Decl(propertyNamedPrototype.ts, 0, 0))
|
||||
|
||||
prototype: number; // ok
|
||||
>prototype : Symbol(C.prototype, Decl(propertyNamedPrototype.ts, 0, 9))
|
||||
|
||||
static prototype: C; // error
|
||||
>prototype : Symbol(C.prototype, Decl(propertyNamedPrototype.ts, 1, 22))
|
||||
>C : Symbol(C, Decl(propertyNamedPrototype.ts, 0, 0))
|
||||
}
|
||||
11
tests/baselines/reference/propertyNamedPrototype.types
Normal file
11
tests/baselines/reference/propertyNamedPrototype.types
Normal file
@ -0,0 +1,11 @@
|
||||
=== tests/cases/conformance/classes/propertyMemberDeclarations/propertyNamedPrototype.ts ===
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
prototype: number; // ok
|
||||
>prototype : number
|
||||
|
||||
static prototype: C; // error
|
||||
>prototype : C
|
||||
>C : C
|
||||
}
|
||||
@ -1,17 +1,17 @@
|
||||
tests/cases/compiler/reassignStaticProp.ts(3,12): error TS2300: Duplicate identifier 'bar'.
|
||||
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 (2 errors) ====
|
||||
class foo {
|
||||
|
||||
static bar = 1;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'bar'.
|
||||
|
||||
static bar:string; // errror - duplicate id
|
||||
~~~
|
||||
!!! 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'.
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
tests/cases/compiler/staticPrototypeProperty.ts(2,11): error TS2300: Duplicate identifier 'prototype'.
|
||||
tests/cases/compiler/staticPrototypeProperty.ts(6,11): error TS2300: Duplicate identifier 'prototype'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/staticPrototypeProperty.ts (2 errors) ====
|
||||
==== tests/cases/compiler/staticPrototypeProperty.ts (1 errors) ====
|
||||
class C {
|
||||
static prototype() { }
|
||||
~~~~~~~~~
|
||||
@ -11,6 +10,4 @@ tests/cases/compiler/staticPrototypeProperty.ts(6,11): error TS2300: Duplicate i
|
||||
|
||||
class C2 {
|
||||
static prototype;
|
||||
~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'prototype'.
|
||||
}
|
||||
@ -1,8 +1,7 @@
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/stringLiteralTypesInImplementationSignatures2.ts(26,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/stringLiteralTypesInImplementationSignatures2.ts(27,5): error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/stringLiteralTypesInImplementationSignatures2.ts (2 errors) ====
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/stringLiteralTypesInImplementationSignatures2.ts (1 errors) ====
|
||||
// String literal types are only valid in overload signatures
|
||||
|
||||
function foo(x: any);
|
||||
@ -29,8 +28,6 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/stringLiteralType
|
||||
|
||||
var b = {
|
||||
foo(x: 'hi') { },
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
foo(x: 'a') { },
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
@ -1,57 +1,45 @@
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(2,5): error TS2300: Duplicate identifier '"a b"'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(3,5): error TS2300: Duplicate identifier '"a b"'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(4,12): error TS2300: Duplicate identifier '"c d"'.
|
||||
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"'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(15,5): error TS2300: Duplicate identifier '"a b"'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(19,5): error TS2300: Duplicate identifier '"a b"'.
|
||||
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'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(15,5): error TS2300: Duplicate identifier 'a b'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(20,5): error TS1005: ',' expected.
|
||||
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts(20,5): error TS2300: Duplicate identifier '"a b"'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts (11 errors) ====
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts (7 errors) ====
|
||||
class C {
|
||||
"a b": number;
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier '"a b"'.
|
||||
"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"'.
|
||||
static "c d": number;
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier '"c d"'.
|
||||
!!! error TS2300: Duplicate identifier 'c d'.
|
||||
}
|
||||
|
||||
interface I {
|
||||
"a b": number;
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier '"a b"'.
|
||||
!!! error TS2300: Duplicate identifier 'a b'.
|
||||
"a b": number;
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier '"a b"'.
|
||||
!!! error TS2300: Duplicate identifier 'a b'.
|
||||
}
|
||||
|
||||
var a: {
|
||||
"a b": number;
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier '"a b"'.
|
||||
!!! error TS2300: Duplicate identifier 'a b'.
|
||||
"a b": number;
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier '"a b"'.
|
||||
!!! error TS2300: Duplicate identifier 'a b'.
|
||||
}
|
||||
|
||||
var b = {
|
||||
"a b": 1
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier '"a b"'.
|
||||
"a b": 1
|
||||
~~~~~
|
||||
!!! error TS1005: ',' expected.
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier '"a b"'.
|
||||
}
|
||||
@ -1,12 +1,9 @@
|
||||
tests/cases/conformance/es6/Symbols/symbolProperty36.ts(2,5): error TS2300: Duplicate identifier '[Symbol.isConcatSpreadable]'.
|
||||
tests/cases/conformance/es6/Symbols/symbolProperty36.ts(3,5): error TS2300: Duplicate identifier '[Symbol.isConcatSpreadable]'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/Symbols/symbolProperty36.ts (2 errors) ====
|
||||
==== tests/cases/conformance/es6/Symbols/symbolProperty36.ts (1 errors) ====
|
||||
var x = {
|
||||
[Symbol.isConcatSpreadable]: 0,
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier '[Symbol.isConcatSpreadable]'.
|
||||
[Symbol.isConcatSpreadable]: 1
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier '[Symbol.isConcatSpreadable]'.
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
tests/cases/conformance/es6/Symbols/symbolProperty37.ts(2,5): error TS2300: Duplicate identifier '[Symbol.isConcatSpreadable]'.
|
||||
tests/cases/conformance/es6/Symbols/symbolProperty37.ts(3,5): error TS2300: Duplicate identifier '[Symbol.isConcatSpreadable]'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/Symbols/symbolProperty37.ts (2 errors) ====
|
||||
interface I {
|
||||
[Symbol.isConcatSpreadable]: string;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier '[Symbol.isConcatSpreadable]'.
|
||||
[Symbol.isConcatSpreadable]: string;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier '[Symbol.isConcatSpreadable]'.
|
||||
}
|
||||
14
tests/baselines/reference/symbolProperty37.symbols
Normal file
14
tests/baselines/reference/symbolProperty37.symbols
Normal file
@ -0,0 +1,14 @@
|
||||
=== tests/cases/conformance/es6/Symbols/symbolProperty37.ts ===
|
||||
interface I {
|
||||
>I : Symbol(I, Decl(symbolProperty37.ts, 0, 0))
|
||||
|
||||
[Symbol.isConcatSpreadable]: string;
|
||||
>Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
[Symbol.isConcatSpreadable]: string;
|
||||
>Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
}
|
||||
14
tests/baselines/reference/symbolProperty37.types
Normal file
14
tests/baselines/reference/symbolProperty37.types
Normal file
@ -0,0 +1,14 @@
|
||||
=== tests/cases/conformance/es6/Symbols/symbolProperty37.ts ===
|
||||
interface I {
|
||||
>I : I
|
||||
|
||||
[Symbol.isConcatSpreadable]: string;
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : symbol
|
||||
|
||||
[Symbol.isConcatSpreadable]: string;
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : symbol
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
tests/cases/conformance/es6/Symbols/symbolProperty38.ts(2,5): error TS2300: Duplicate identifier '[Symbol.isConcatSpreadable]'.
|
||||
tests/cases/conformance/es6/Symbols/symbolProperty38.ts(5,5): error TS2300: Duplicate identifier '[Symbol.isConcatSpreadable]'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/Symbols/symbolProperty38.ts (2 errors) ====
|
||||
interface I {
|
||||
[Symbol.isConcatSpreadable]: string;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier '[Symbol.isConcatSpreadable]'.
|
||||
}
|
||||
interface I {
|
||||
[Symbol.isConcatSpreadable]: string;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier '[Symbol.isConcatSpreadable]'.
|
||||
}
|
||||
17
tests/baselines/reference/symbolProperty38.symbols
Normal file
17
tests/baselines/reference/symbolProperty38.symbols
Normal file
@ -0,0 +1,17 @@
|
||||
=== tests/cases/conformance/es6/Symbols/symbolProperty38.ts ===
|
||||
interface I {
|
||||
>I : Symbol(I, Decl(symbolProperty38.ts, 0, 0), Decl(symbolProperty38.ts, 2, 1))
|
||||
|
||||
[Symbol.isConcatSpreadable]: string;
|
||||
>Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
}
|
||||
interface I {
|
||||
>I : Symbol(I, Decl(symbolProperty38.ts, 0, 0), Decl(symbolProperty38.ts, 2, 1))
|
||||
|
||||
[Symbol.isConcatSpreadable]: string;
|
||||
>Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
}
|
||||
17
tests/baselines/reference/symbolProperty38.types
Normal file
17
tests/baselines/reference/symbolProperty38.types
Normal file
@ -0,0 +1,17 @@
|
||||
=== tests/cases/conformance/es6/Symbols/symbolProperty38.ts ===
|
||||
interface I {
|
||||
>I : I
|
||||
|
||||
[Symbol.isConcatSpreadable]: string;
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : symbol
|
||||
}
|
||||
interface I {
|
||||
>I : I
|
||||
|
||||
[Symbol.isConcatSpreadable]: string;
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : symbol
|
||||
}
|
||||
@ -1,8 +1,9 @@
|
||||
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 (2 errors) ====
|
||||
==== tests/cases/conformance/es6/Symbols/symbolProperty44.ts (3 errors) ====
|
||||
class C {
|
||||
get [Symbol.hasInstance]() {
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
@ -12,6 +13,8 @@ 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 "";
|
||||
}
|
||||
}
|
||||
4
tests/cases/compiler/duplicateIdentifierComputedName.ts
Normal file
4
tests/cases/compiler/duplicateIdentifierComputedName.ts
Normal file
@ -0,0 +1,4 @@
|
||||
class C {
|
||||
["a"]: string;
|
||||
["a"]: string;
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
// Not OK
|
||||
interface B { x; }
|
||||
interface B { x?; }
|
||||
|
||||
// OK
|
||||
class A {
|
||||
public y: string;
|
||||
}
|
||||
|
||||
interface A {
|
||||
y: string;
|
||||
}
|
||||
|
||||
// Not OK
|
||||
class C {
|
||||
private y: string;
|
||||
}
|
||||
|
||||
interface C {
|
||||
y: string;
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
class A {
|
||||
0b11 = '';
|
||||
3 = '';
|
||||
}
|
||||
|
||||
var X = { 0b11: '', 3: '' };
|
||||
Loading…
x
Reference in New Issue
Block a user