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