22 lines
No EOL
1.2 KiB
Text
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.
|
|
} |