TypeScript/tests/baselines/reference/stringIndexerAssignments2.errors.txt

28 lines
620 B
Text
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/stringIndexerAssignments2.ts (2 errors) ====
class C1 {
[index: string]: string
one: string;
}
class C2 {
one: string;
}
class C3 {
one: number;
two: string;
}
var x: C1;
var a: C2;
var b: C3;
x = a;
~
!!! Type 'C2' is not assignable to type 'C1':
!!! Index signature is missing in type 'C2'.
x = b;
~
!!! Type 'C3' is not assignable to type 'C1':
!!! Types of property 'one' are incompatible:
!!! Type 'number' is not assignable to type 'string'.