TypeScript/tests/baselines/reference/computedPropertyNames44_ES5.errors.txt
2015-02-04 15:33:53 -08:00

20 lines
957 B
Plaintext

tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(6,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(10,5): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts (2 errors) ====
class Foo { x }
class Foo2 { x; y }
class C {
[s: string]: Foo2;
get ["get1"]() { return new Foo }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
}
class D extends C {
set ["set1"](p: Foo) { }
~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
}