Skip to content

Functions defined as methods fail type inferrence when they have arguments #200

@thennothinghappened

Description

@thennothinghappened

Below is an example of this.
image

Interestingly, this doesn't happen when defining as a regular function, as in the second example, but does when assigned as a method in a constructor.
image

Also of note, removing the explicit type annotations it now believes it returns nothing:
image

Removing the argument (or its type annotation) also fixes it, but it refuses to acknowledge the return type still:
image

Finally, using JSDoc comments seem to always work:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions