Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thennothinghappened opened this issue Sep 30, 2023 · 0 comments
Labels

Comments

@thennothinghappened
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants