We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
class method function assignment variable this bind
Playground link with relevant code
class User { name: string | undefined setName(name: string) { this.name = name } } const user = new User() const setNameFunction = user.setName setNameFunction('bob')
setNameFunction
(name: string) => void
(this: User, name: string) => void
setNameFunction('bob')
The text was updated successfully, but these errors were encountered:
See #7968 and #6739
Sorry, something went wrong.
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
Bug Report
π Search Terms
class method function assignment variable this bind
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
setNameFunction
is inferred to be(name: string) => void
π Expected behavior
setNameFunction
should be inferred to be(this: User, name: string) => void
setNameFunction('bob')
will fail in runtimeThe text was updated successfully, but these errors were encountered: