Files
tsgo/testdata/baselines/reference/submodule/compiler/duplicateObjectLiteralProperty_computedName1.errors.txt

56 lines
2.1 KiB
Plaintext

duplicateObjectLiteralProperty_computedName1.ts(3,5): error TS1117: An object literal cannot have multiple properties with the same name.
duplicateObjectLiteralProperty_computedName1.ts(8,5): error TS1117: An object literal cannot have multiple properties with the same name.
duplicateObjectLiteralProperty_computedName1.ts(13,5): error TS1117: An object literal cannot have multiple properties with the same name.
duplicateObjectLiteralProperty_computedName1.ts(23,5): error TS1117: An object literal cannot have multiple properties with the same name.
duplicateObjectLiteralProperty_computedName1.ts(28,5): error TS1117: An object literal cannot have multiple properties with the same name.
duplicateObjectLiteralProperty_computedName1.ts(33,5): error TS1117: An object literal cannot have multiple properties with the same name.
==== duplicateObjectLiteralProperty_computedName1.ts (6 errors) ====
const t1 = {
1: 1,
[1]: 0 // duplicate
~~~
!!! error TS1117: An object literal cannot have multiple properties with the same name.
}
const t2 = {
1: 1,
[+1]: 0 // duplicate
~~~~
!!! error TS1117: An object literal cannot have multiple properties with the same name.
}
const t3 = {
"1": 1,
[+1]: 0 // duplicate
~~~~
!!! error TS1117: An object literal cannot have multiple properties with the same name.
}
const t4 = {
"+1": 1,
[+1]: 0 // two different keys, "+1", "1"
}
const t5 = {
"+1": 1,
["+1"]: 0 // duplicate
~~~~~~
!!! error TS1117: An object literal cannot have multiple properties with the same name.
}
const t6 = {
"-1": 1,
[-1]: 0 // duplicate
~~~~
!!! error TS1117: An object literal cannot have multiple properties with the same name.
}
const t7 = {
"-1": 1,
["-1"]: 0 // duplicate
~~~~~~
!!! error TS1117: An object literal cannot have multiple properties with the same name.
}