Skip to content

@this incorrectly applies in TS files in typeToString #52594

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

Closed
sandersn opened this issue Feb 3, 2023 · 0 comments · Fixed by #52610
Closed

@this incorrectly applies in TS files in typeToString #52594

sandersn opened this issue Feb 3, 2023 · 0 comments · Fixed by #52610

Comments

@sandersn
Copy link
Member

sandersn commented Feb 3, 2023

// @strict: true
/** @this {number} */
function nothis/*1*/() {
  this // noImplicitThis error here
}
nothis() // `this` not required to call

Quickinfo at /*1*/, and type baselines, print the type of nothis as (this: number) => void, even in Typescript where the tag should be ignored. But the type checker still has this: any, so I think it's a bug inside typeToString.

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

Successfully merging a pull request may close this issue.

1 participant