TypeScript/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt
Daniel Rosenwasser 6e77e2e810 Removed colons from diagnostic messages.
Also got rid of the 'terminalMessages' concept.
2014-10-28 00:48:58 -07:00

51 lines
No EOL
2.3 KiB
Text

tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(7,1): error TS2323: Type 'I' is not assignable to type 'Object'.
Types of property 'toString' are incompatible.
Type '() => void' is not assignable to type '() => string'.
Type 'void' is not assignable to type 'string'.
tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(14,1): error TS2323: Type 'C' is not assignable to type 'Object'.
Types of property 'toString' are incompatible.
Type '() => void' is not assignable to type '() => string'.
Type 'void' is not assignable to type 'string'.
tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(20,1): error TS2323: Type '{ toString: () => void; }' is not assignable to type 'Object'.
Types of property 'toString' are incompatible.
Type '() => void' is not assignable to type '() => string'.
Type 'void' is not assignable to type 'string'.
==== tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts (3 errors) ====
interface I {
toString(): void;
}
var i: I;
var o: Object;
o = i; // error
~
!!! error TS2323: Type 'I' is not assignable to type 'Object'.
!!! error TS2323: Types of property 'toString' are incompatible.
!!! error TS2323: Type '() => void' is not assignable to type '() => string'.
!!! error TS2323: Type 'void' is not assignable to type 'string'.
i = o; // ok
class C {
toString(): void { }
}
var c: C;
o = c; // error
~
!!! error TS2323: Type 'C' is not assignable to type 'Object'.
!!! error TS2323: Types of property 'toString' are incompatible.
!!! error TS2323: Type '() => void' is not assignable to type '() => string'.
!!! error TS2323: Type 'void' is not assignable to type 'string'.
c = o; // ok
var a = {
toString: () => { }
}
o = a; // error
~
!!! error TS2323: Type '{ toString: () => void; }' is not assignable to type 'Object'.
!!! error TS2323: Types of property 'toString' are incompatible.
!!! error TS2323: Type '() => void' is not assignable to type '() => string'.
!!! error TS2323: Type 'void' is not assignable to type 'string'.
a = o; // ok