Files

18 lines
720 B
Plaintext

i3.ts(6,1): error TS2322: Type 'I3' is not assignable to type '{ one: number; }'.
Types of property 'one' are incompatible.
Type 'number | undefined' is not assignable to type 'number'.
Type 'undefined' is not assignable to type 'number'.
==== i3.ts (1 errors) ====
interface I3 { one?: number; };
declare var x: {one: number};
declare var i: I3;
i = x;
x = i;
~
!!! error TS2322: Type 'I3' is not assignable to type '{ one: number; }'.
!!! error TS2322: Types of property 'one' are incompatible.
!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'.
!!! error TS2322: Type 'undefined' is not assignable to type 'number'.