24 lines
1.3 KiB
Plaintext
24 lines
1.3 KiB
Plaintext
tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(10,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
|
tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(10,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
|
|
tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(11,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
|
|
|
|
|
|
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts (3 errors) ====
|
|
class Foo { x }
|
|
class Foo2 { x; y }
|
|
|
|
class C {
|
|
[s: string]: Foo2;
|
|
}
|
|
|
|
class D extends C {
|
|
// Computed properties
|
|
get ["get1"]() { return new Foo }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
|
~~~~~~~~
|
|
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
|
|
set ["set1"](p: Foo2) { }
|
|
~~~~~~~~
|
|
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
|
|
} |