Skip to content

Incorrect error for bad argument of a DOM type #27049

Closed
@sandersn

Description

@sandersn
declare var ohno: new () => Node;
declare function ff(t: Node): void;
ff(ohno)

Expected behavior:
Error: "Argument of type 'new () => Node' is not assignable to parameter of type 'Node'

Actual behavior:
Type 'new () => Node' is not assignable to type 'Node'.

Only seems to repro when both the source and target types are in the DOM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions