Skip to content

Type compatibility/can assign #349

@carloszimm

Description

@carloszimm

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions