mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
40 lines
1.4 KiB
Plaintext
40 lines
1.4 KiB
Plaintext
duplicateObjectLiteralProperty_computedName2.ts(8,5): error TS1117: An object literal cannot have multiple properties with the same name.
|
|
duplicateObjectLiteralProperty_computedName2.ts(13,5): error TS1117: An object literal cannot have multiple properties with the same name.
|
|
duplicateObjectLiteralProperty_computedName2.ts(18,5): error TS1117: An object literal cannot have multiple properties with the same name.
|
|
duplicateObjectLiteralProperty_computedName2.ts(23,5): error TS1117: An object literal cannot have multiple properties with the same name.
|
|
|
|
|
|
==== duplicateObjectLiteralProperty_computedName2.ts (4 errors) ====
|
|
const n = 1;
|
|
const s = "s";
|
|
enum E1 { A = "ENUM_KEY" }
|
|
enum E2 { B }
|
|
|
|
const t1 = {
|
|
[n]: 1,
|
|
[n]: 1, // duplicate
|
|
~~~
|
|
!!! error TS1117: An object literal cannot have multiple properties with the same name.
|
|
}
|
|
|
|
const t2 = {
|
|
[s]: 1,
|
|
[s]: 1, // duplicate
|
|
~~~
|
|
!!! error TS1117: An object literal cannot have multiple properties with the same name.
|
|
}
|
|
|
|
const t3 = {
|
|
[E1.A]: 1,
|
|
[E1.A]: 1, // duplicate
|
|
~~~~~~
|
|
!!! error TS1117: An object literal cannot have multiple properties with the same name.
|
|
}
|
|
|
|
const t4 = {
|
|
[E2.B]: 1,
|
|
[E2.B]: 1, // duplicate
|
|
~~~~~~
|
|
!!! error TS1117: An object literal cannot have multiple properties with the same name.
|
|
}
|
|
|