You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue occur when all extensions are disabled?: Yes/No
VS Code Version: 1.97.2
OS Version: x64 10.0.19045
Steps to Reproduce:
Type the code
let m = { a: 3, f() { return this.a } }
into a file and store it with "js" and then with "ts" extension.
When the language is javascript, the "this" identifier has the type of the literal and this.a is a number.
The same is expected for typescript, but in typescript mode this is any and this.a is "No definition found for 'a'"
Tested with all extensions disabled.
Switching the language mode does not change the behavior, it depends only on the file extension "js" versus "ts".
The expectation is that in typescript mode, the behavior is the same as in javascript and that members are recognized. The type of f() should be a method returning a number. Currently it is recognized as any:
The text was updated successfully, but these errors were encountered:
Does this issue occur when all extensions are disabled?: Yes/No
Steps to Reproduce:
Type the code
let m = { a: 3, f() { return this.a } }
into a file and store it with "js" and then with "ts" extension.
When the language is javascript, the "this" identifier has the type of the literal and this.a is a number.
The same is expected for typescript, but in typescript mode this is any and this.a is "No definition found for 'a'"
Tested with all extensions disabled.
Switching the language mode does not change the behavior, it depends only on the file extension "js" versus "ts".
The expectation is that in typescript mode, the behavior is the same as in javascript and that members are recognized. The type of f() should be a method returning a number. Currently it is recognized as any:
The text was updated successfully, but these errors were encountered: