Closed
Description
TypeScript Version: 2.5.1
Code
For the JS:
function Foo() {
this.init();
}
Foo.prototype.init = function () {
// code
}
const a = new Foo();
a.init()
Expected behavior:
In the function Foo
, this
is the type of Foo
and you can run go to definition
on this.init
Actual behavior:
this
is any
. go to definition
does not work on this.init
but does on a.init
Metadata
Metadata
Assignees
Labels
A bug in TypeScriptThe issue relates to JavaScript specificallyRelates to go-to-definition, find-all-references, highlighting/occurrences.Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".A PR has been opened for this issueThere is a VS Code equivalent to this issue