21 lines
No EOL
992 B
Text
21 lines
No EOL
992 B
Text
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(6,5): error TS2322: Type '{ [x: string]: string | number; [x: number]: undefined; }' is not assignable to type 'I'.
|
|
Index signatures are incompatible.
|
|
Type 'string | number' is not assignable to type 'boolean'.
|
|
Type 'string' is not assignable to type 'boolean'.
|
|
|
|
|
|
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts (1 errors) ====
|
|
interface I {
|
|
[s: string]: boolean;
|
|
[s: number]: boolean;
|
|
}
|
|
|
|
var o: I = {
|
|
~
|
|
!!! error TS2322: Type '{ [x: string]: string | number; [x: number]: undefined; }' is not assignable to type 'I'.
|
|
!!! error TS2322: Index signatures are incompatible.
|
|
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'.
|
|
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
|
|
[""+"foo"]: "",
|
|
[""+"bar"]: 0
|
|
} |