TypeScript/tests/baselines/reference/computedPropertyNames39_ES5.errors.txt
2015-02-03 17:43:31 -08:00

22 lines
No EOL
1.2 KiB
Text

tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts(8,5): error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts(8,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts(9,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts (3 errors) ====
class Foo { x }
class Foo2 { x; y }
class C {
[s: number]: Foo2;
// Computed properties
get [1 << 6]() { return new Foo }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'.
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set [1 << 6](p: Foo2) { }
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}