50 lines
2.3 KiB
Plaintext
50 lines
2.3 KiB
Plaintext
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(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(22,5): error TS2300: Duplicate identifier '0'.
|
|
|
|
|
|
==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts (8 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'.
|
|
}
|
|
|
|
interface I {
|
|
"1": number;
|
|
~~~
|
|
!!! error TS2300: Duplicate identifier '"1"'.
|
|
"1.": number; // not a duplicate
|
|
1: number;
|
|
~
|
|
!!! error TS2300: Duplicate identifier '1'.
|
|
}
|
|
|
|
var a: {
|
|
"1": number;
|
|
~~~
|
|
!!! error TS2300: Duplicate identifier '"1"'.
|
|
1.0: string;
|
|
~~~
|
|
!!! error TS2300: Duplicate identifier '1.0'.
|
|
}
|
|
|
|
var b = {
|
|
"0": '',
|
|
~~~
|
|
!!! error TS2300: Duplicate identifier '"0"'.
|
|
0: ''
|
|
~
|
|
!!! error TS2300: Duplicate identifier '0'.
|
|
} |