16 lines
No EOL
643 B
Text
16 lines
No EOL
643 B
Text
tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts(8,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
|
|
|
|
|
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts (1 errors) ====
|
|
class Foo { x }
|
|
class Foo2 { x; y }
|
|
|
|
class C {
|
|
[s: string]: Foo2;
|
|
|
|
// Computed properties
|
|
get ["get1"]() { return new Foo }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
|
set ["set1"](p: Foo2) { }
|
|
} |