-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Add related span pointing to this-shadowing location for implicitly-any this #28299
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
Conversation
this.m(); | ||
~~~~ | ||
!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. | ||
!!! related TS2735 tests/cases/compiler/thisShadowingErrorSpans.ts:4:18: There is a 'this' type shadowed by this container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a side note...I think we need better baselines for related information.. Just looking at this baseline first thing I see from message is I don't think message clearly states that its talking about f
but then later I saw span. May be it would be good idea to use pretty formatting of related information instead because that's how its going to emerge anyways?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you set the pretty flag in the test options, it actually does get recorded like that. I was told that it wasn't typically necessary though, esp. since pretty also has a bunch of formatting characters which don't translate to plaintext well.
…ny this (#28299) * Add diagnostic pointing to this-shadowing location * Fix almost-top-level-this case * Change message on span
Fixes #26461