TypeScript/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt

37 lines
1.1 KiB
Text
Raw Normal View History

==== tests/cases/compiler/duplicateObjectLiteralProperty.ts (9 errors) ====
2014-07-13 01:04:16 +02:00
var x = {
a: 1,
b: true, // OK
a: 56, // Duplicate
~
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
\u0061: "ss", // Duplicate
~~~~~~
!!! error TS2300: Duplicate identifier '\u0061'.
2014-07-13 01:04:16 +02:00
a: {
~
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
c: 1,
"c": 56, // Duplicate
~~~
!!! error TS2300: Duplicate identifier '"c"'.
2014-07-13 01:04:16 +02:00
}
};
var y = {
get a() { return 0; },
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
set a(v: number) { },
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
get a() { return 0; }
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
~
!!! error TS1118: An object literal cannot have multiple get/set accessors with the same name.
~
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
};