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

Parameter inlay hint is incorrect when function has a this type #60375

Closed
yume-chan opened this issue Oct 30, 2024 · 0 comments Β· Fixed by #60378
Closed

Parameter inlay hint is incorrect when function has a this type #60375

yume-chan opened this issue Oct 30, 2024 · 0 comments Β· Fixed by #60378
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@yume-chan
Copy link
Contributor

πŸ”Ž Search Terms

inlay hint this

πŸ•— Version & Regression Information

  • I was unable to test this on prior versions because it requires changing TypeScript version in Visual Studio Code

⏯ Playground Link

https://www.typescriptlang.org/play/?#code/CYUwxgNghgTiAEAzArgOzAFwJYHtVNQAoAoeeMKCCAIyjAGsAueQqZ1ZAW2pBgBp41ZgGcMMLKgDmASngBeAHzwAbjizBi05qvUBuYsUREU6bHhYYAFlmHsuPfvCgDqsgN7wAvtP1A

πŸ’» Code

declare function fn(
  callback: (a: number, b: string) => void
): void;

fn(function (this: number, a, b) { });

πŸ™ Actual behavior

Inlay hint on parameter a shows :string, but it's actually a number:

Image

And inlay hint for b is missing

πŸ™‚ Expected behavior

Should display a: number, b: string

Additional information about the issue

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants