TypeScript/tests/baselines/reference/stringIndexerAssignments2.errors.txt
2014-07-12 17:30:19 -07:00

28 lines
620 B
Plaintext

==== 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'.