Skip to content

how come () => void is a subtype of () => a if void isn't a subtype of a and a isn't subtype of void? #8581

@zpdDG4gta8XKpMCd

Description

@zpdDG4gta8XKpMCd
declare var a: () => void;
declare var b: () => PromiseLike<void>;

a = b; // <-- why!!!
b = a;


declare var c: void;
declare var d: PromiseLike<void>;

c = d;
d = c;

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions