32 lines
No EOL
834 B
Text
32 lines
No EOL
834 B
Text
==== 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;
|
|
~~~
|
|
!!! Duplicate identifier '1.0'.
|
|
}
|
|
|
|
interface I {
|
|
"1": number;
|
|
"1.": number; // not a duplicate
|
|
1: number;
|
|
~
|
|
!!! Duplicate identifier '1'.
|
|
}
|
|
|
|
var a: {
|
|
"1": number;
|
|
1.0: string;
|
|
~~~
|
|
!!! Duplicate identifier '1.0'.
|
|
}
|
|
|
|
var b = {
|
|
"0": '',
|
|
0: ''
|
|
~
|
|
!!! Duplicate identifier '0'.
|
|
} |