2014-10-01 02:15:18 +02:00
|
|
|
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(4,5): error TS2300: Duplicate identifier '"1"'.
|
2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(6,5): error TS2300: Duplicate identifier '1.0'.
|
2014-10-01 02:15:18 +02:00
|
|
|
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(10,5): error TS2300: Duplicate identifier '"1"'.
|
2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(12,5): error TS2300: Duplicate identifier '1'.
|
2014-10-01 02:15:18 +02:00
|
|
|
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(16,5): error TS2300: Duplicate identifier '"1"'.
|
2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(17,5): error TS2300: Duplicate identifier '1.0'.
|
2014-10-01 02:15:18 +02:00
|
|
|
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(21,5): error TS2300: Duplicate identifier '"0"'.
|
2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(22,5): error TS2300: Duplicate identifier '0'.
|
|
|
|
|
|
|
|
|
2014-10-01 02:15:18 +02:00
|
|
|
==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts (8 errors) ====
|
2014-07-13 01:04:16 +02:00
|
|
|
// 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;
|
2014-10-01 02:15:18 +02:00
|
|
|
~~~
|
|
|
|
!!! error TS2300: Duplicate identifier '"1"'.
|
2014-07-13 01:04:16 +02:00
|
|
|
"1.0": number; // not a duplicate
|
|
|
|
1.0: number;
|
2014-10-01 20:27:20 +02:00
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2300: Duplicate identifier '1.0'.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface I {
|
|
|
|
"1": number;
|
2014-10-01 02:15:18 +02:00
|
|
|
~~~
|
|
|
|
!!! error TS2300: Duplicate identifier '"1"'.
|
2014-07-13 01:04:16 +02:00
|
|
|
"1.": number; // not a duplicate
|
|
|
|
1: number;
|
2014-10-01 20:27:20 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2300: Duplicate identifier '1'.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var a: {
|
|
|
|
"1": number;
|
|
|
|
~~~
|
2014-10-01 02:15:18 +02:00
|
|
|
!!! error TS2300: Duplicate identifier '"1"'.
|
|
|
|
1.0: string;
|
2014-10-01 20:27:20 +02:00
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2300: Duplicate identifier '1.0'.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var b = {
|
|
|
|
"0": '',
|
2014-10-01 02:15:18 +02:00
|
|
|
~~~
|
|
|
|
!!! error TS2300: Duplicate identifier '"0"'.
|
2014-07-13 01:04:16 +02:00
|
|
|
0: ''
|
2014-10-01 20:27:20 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2300: Duplicate identifier '0'.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|