type-plus icon indicating copy to clipboard operation
type-plus copied to clipboard

Type compatibility/can assign

Open carloszimm opened this issue 11 months ago • 5 comments

Forgive me if I have understood wrong (the functionality) but the following code shouldn't work without compiler problems?

assertType.isTrue(true as CanAssign<any, number>);

If the order is inverted, it works fine. Also, the following code apparently compiles:

let a: any = 4;
let b: number = a;

let d: number = 3;
let e: any = d;

StackBlitz print: image

Thank you :)

carloszimm avatar Aug 15 '23 03:08 carloszimm