16 lines
637 B
Text
16 lines
637 B
Text
|
tests/cases/conformance/es6/computedProperties/computedPropertyNames39.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.ts (1 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'.
|
||
|
set [1 << 6](p: Foo2) { }
|
||
|
}
|