2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,19): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher.
2014-11-20 01:32:27 +01:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,22): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,23): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,22): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,25): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,23): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,22): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,24): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,24): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,24): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,25): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,25): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,23): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,23): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS1119: An object literal cannot have property and accessor with the same name.
2014-11-20 22:48:23 +01:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,23): error TS1119: An object literal cannot have property and accessor with the same name.
2014-11-20 01:32:27 +01:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,27): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,26): error TS1119: An object literal cannot have property and accessor with the same name.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46): error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(3,12): error TS2300: Duplicate identifier 'a'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(3,18): error TS2300: Duplicate identifier 'a'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(4,12): error TS2300: Duplicate identifier 'a'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(4,19): error TS2300: Duplicate identifier 'a'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(5,12): error TS2300: Duplicate identifier 'a'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(5,18): error TS2300: Duplicate identifier 'a'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(6,12): error TS2300: Duplicate identifier 'a'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(6,21): error TS2300: Duplicate identifier 'a'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(7,12): error TS2300: Duplicate identifier 'a'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(7,19): error TS2300: Duplicate identifier 'a'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(8,12): error TS2300: Duplicate identifier 'a'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(8,18): error TS2300: Duplicate identifier ''a''.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(9,12): error TS2300: Duplicate identifier ''a''.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(9,20): error TS2300: Duplicate identifier 'a'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(10,12): error TS2300: Duplicate identifier ''a''.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(10,20): error TS2300: Duplicate identifier '"a"'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(11,12): error TS2300: Duplicate identifier ''a''.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(11,20): error TS2300: Duplicate identifier ''a''.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(12,13): error TS2300: Duplicate identifier '"a"'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(12,21): error TS2300: Duplicate identifier ''a''.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(13,13): error TS2300: Duplicate identifier '1.0'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(13,21): error TS2300: Duplicate identifier ''1''.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(14,13): error TS2300: Duplicate identifier '0'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(14,19): error TS2300: Duplicate identifier '0'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(15,13): error TS2300: Duplicate identifier '0'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(15,19): error TS2300: Duplicate identifier '0'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,13): error TS2300: Duplicate identifier '0'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,19): error TS2300: Duplicate identifier '0x0'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,13): error TS2300: Duplicate identifier '0'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,19): error TS2300: Duplicate identifier '000'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(18,13): error TS2300: Duplicate identifier '"100"'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(18,23): error TS2300: Duplicate identifier '1e2'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(19,13): error TS2300: Duplicate identifier '0x20'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(19,22): error TS2300: Duplicate identifier '3.2e1'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(20,13): error TS2300: Duplicate identifier 'a'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(20,25): error TS2300: Duplicate identifier 'a'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,12): error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,22): error TS2300: Duplicate identifier 'a'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,12): error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,23): error TS2300: Duplicate identifier 'a'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,12): error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,22): error TS2300: Duplicate identifier 'a'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,12): error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,25): error TS2300: Duplicate identifier 'a'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,12): error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,23): error TS2300: Duplicate identifier 'a'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,12): error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,22): error TS2300: Duplicate identifier ''a''.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,12): error TS2300: Duplicate identifier ''a''.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,24): error TS2300: Duplicate identifier 'a'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,12): error TS2300: Duplicate identifier ''a''.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,24): error TS2300: Duplicate identifier '"a"'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,12): error TS2300: Duplicate identifier ''a''.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,24): error TS2300: Duplicate identifier ''a''.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,13): error TS2300: Duplicate identifier '"a"'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,25): error TS2300: Duplicate identifier ''a''.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,13): error TS2300: Duplicate identifier '1.0'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,25): error TS2300: Duplicate identifier ''1''.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,13): error TS2300: Duplicate identifier '0'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,23): error TS2300: Duplicate identifier '0'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,13): error TS2300: Duplicate identifier '0'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,23): error TS2300: Duplicate identifier '0'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,13): error TS2300: Duplicate identifier '0'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS2300: Duplicate identifier '0x0'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,13): error TS2300: Duplicate identifier '0'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,23): error TS2300: Duplicate identifier '000'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,13): error TS2300: Duplicate identifier '"100"'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,27): error TS2300: Duplicate identifier '1e2'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,13): error TS2300: Duplicate identifier '0x20'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,26): error TS2300: Duplicate identifier '3.2e1'.
2014-10-01 02:15:18 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,13): error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46): error TS2300: Duplicate identifier 'a'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,12): error TS2380: 'get' and 'set' accessor must have the same type.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,43): error TS2380: 'get' and 'set' accessor must have the same type.
2014-11-05 21:26:03 +01:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(44,29): error TS2322: Type 'number' is not assignable to type 'string'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,12): error TS2380: 'get' and 'set' accessor must have the same type.
tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51): error TS2380: 'get' and 'set' accessor must have the same type.
2014-11-20 01:32:27 +01:00
==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (96 errors) ====
2014-07-13 01:04:16 +02:00
// Multiple properties with the same name
var e1 = { a: 0, a: 0 };
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
var e2 = { a: '', a: '' };
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
var e3 = { a: 0, a: '' };
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
var e4 = { a: true, a: false };
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
var e5 = { a: {}, a: {} };
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
var e6 = { a: 0, 'a': 0 };
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier ''a''.
2014-07-13 01:04:16 +02:00
var e7 = { 'a': 0, a: 0 };
2014-10-01 02:15:18 +02:00
~~~
!!! error TS2300: Duplicate identifier ''a''.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
var e8 = { 'a': 0, "a": 0 };
2014-10-01 02:15:18 +02:00
~~~
!!! error TS2300: Duplicate identifier ''a''.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier '"a"'.
2014-07-13 01:04:16 +02:00
var e9 = { 'a': 0, 'a': 0 };
2014-10-01 02:15:18 +02:00
~~~
!!! error TS2300: Duplicate identifier ''a''.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier ''a''.
2014-07-13 01:04:16 +02:00
var e10 = { "a": 0, 'a': 0 };
2014-10-01 02:15:18 +02:00
~~~
!!! error TS2300: Duplicate identifier '"a"'.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier ''a''.
2014-07-13 01:04:16 +02:00
var e11 = { 1.0: 0, '1': 0 };
2014-10-01 02:15:18 +02:00
~~~
!!! error TS2300: Duplicate identifier '1.0'.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier ''1''.
2014-07-13 01:04:16 +02:00
var e12 = { 0: 0, 0: 0 };
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier '0'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier '0'.
2014-07-13 01:04:16 +02:00
var e13 = { 0: 0, 0: 0 };
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier '0'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier '0'.
2014-07-13 01:04:16 +02:00
var e14 = { 0: 0, 0x0: 0 };
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier '0'.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier '0x0'.
2014-07-13 01:04:16 +02:00
var e14 = { 0: 0, 000: 0 };
~~~
2014-09-12 00:19:57 +02:00
!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher.
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier '0'.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier '000'.
2014-07-13 01:04:16 +02:00
var e15 = { "100": 0, 1e2: 0 };
2014-10-01 02:15:18 +02:00
~~~~~
!!! error TS2300: Duplicate identifier '"100"'.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier '1e2'.
2014-07-13 01:04:16 +02:00
var e16 = { 0x20: 0, 3.2e1: 0 };
2014-10-01 02:15:18 +02:00
~~~~
!!! error TS2300: Duplicate identifier '0x20'.
2014-10-01 20:27:20 +02:00
~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier '3.2e1'.
2014-07-13 01:04:16 +02:00
var e17 = { a: 0, b: 1, a: 0 };
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
// Accessor and property with the same name
var f1 = { a: 0, get a() { return 0; } };
2014-11-20 01:32:27 +01:00
~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
var f2 = { a: '', get a() { return ''; } };
2014-11-20 01:32:27 +01:00
~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
var f3 = { a: 0, get a() { return ''; } };
2014-11-20 01:32:27 +01:00
~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
var f4 = { a: true, get a() { return false; } };
2014-11-20 01:32:27 +01:00
~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
var f5 = { a: {}, get a() { return {}; } };
2014-11-20 01:32:27 +01:00
~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
var f6 = { a: 0, get 'a'() { return 0; } };
2014-11-20 01:32:27 +01:00
~~~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier ''a''.
2014-07-13 01:04:16 +02:00
var f7 = { 'a': 0, get a() { return 0; } };
2014-11-20 01:32:27 +01:00
~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~~~
!!! error TS2300: Duplicate identifier ''a''.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
var f8 = { 'a': 0, get "a"() { return 0; } };
2014-11-20 01:32:27 +01:00
~~~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~~~
!!! error TS2300: Duplicate identifier ''a''.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier '"a"'.
2014-07-13 01:04:16 +02:00
var f9 = { 'a': 0, get 'a'() { return 0; } };
2014-11-20 01:32:27 +01:00
~~~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~~~
!!! error TS2300: Duplicate identifier ''a''.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier ''a''.
2014-07-13 01:04:16 +02:00
var f10 = { "a": 0, get 'a'() { return 0; } };
2014-11-20 01:32:27 +01:00
~~~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~~~
!!! error TS2300: Duplicate identifier '"a"'.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier ''a''.
2014-07-13 01:04:16 +02:00
var f11 = { 1.0: 0, get '1'() { return 0; } };
2014-11-20 01:32:27 +01:00
~~~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~~~
!!! error TS2300: Duplicate identifier '1.0'.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier ''1''.
2014-07-13 01:04:16 +02:00
var f12 = { 0: 0, get 0() { return 0; } };
2014-11-20 01:32:27 +01:00
~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier '0'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier '0'.
2014-07-13 01:04:16 +02:00
var f13 = { 0: 0, get 0() { return 0; } };
2014-11-20 01:32:27 +01:00
~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier '0'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier '0'.
2014-07-13 01:04:16 +02:00
var f14 = { 0: 0, get 0x0() { return 0; } };
2014-11-20 01:32:27 +01:00
~~~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier '0'.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier '0x0'.
2014-07-13 01:04:16 +02:00
var f14 = { 0: 0, get 000() { return 0; } };
~~~
2014-11-20 22:48:23 +01:00
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier '0'.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier '000'.
2014-07-13 01:04:16 +02:00
var f15 = { "100": 0, get 1e2() { return 0; } };
2014-11-20 01:32:27 +01:00
~~~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~~~~~
!!! error TS2300: Duplicate identifier '"100"'.
2014-10-01 20:27:20 +02:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier '1e2'.
2014-07-13 01:04:16 +02:00
var f16 = { 0x20: 0, get 3.2e1() { return 0; } };
2014-11-20 01:32:27 +01:00
~~~~~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~~~~
!!! error TS2300: Duplicate identifier '0x20'.
2014-10-01 20:27:20 +02:00
~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier '3.2e1'.
2014-07-13 01:04:16 +02:00
var f17 = { a: 0, get b() { return 1; }, get a() { return 0; } };
2014-11-20 01:32:27 +01:00
~
!!! error TS1119: An object literal cannot have property and accessor with the same name.
2014-10-01 02:15:18 +02:00
~
!!! error TS2300: Duplicate identifier 'a'.
2014-10-01 20:27:20 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'a'.
2014-07-13 01:04:16 +02:00
// Get and set accessor with mismatched type annotations
var g1 = { get a(): number { return 4; }, set a(n: string) { } };
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2380: 'get' and 'set' accessor must have the same type.
2014-07-13 01:04:16 +02:00
~~~~~~~~~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2380: 'get' and 'set' accessor must have the same type.
2014-07-13 01:04:16 +02:00
var g2 = { get a() { return 4; }, set a(n: string) { } };
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'number' is not assignable to type 'string'.
2014-07-13 01:04:16 +02:00
var g3 = { get a(): number { return undefined; }, set a(n: string) { } };
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2380: 'get' and 'set' accessor must have the same type.
2014-07-13 01:04:16 +02:00
~~~~~~~~~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2380: 'get' and 'set' accessor must have the same type.
2014-07-13 01:04:16 +02:00