-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyHas ReproThis issue has compiler-backed repros: https://aka.ms/ts-reprosThis issue has compiler-backed repros: https://aka.ms/ts-reprosVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Milestone
Description
TypeScript Version: 2.8.0.insiders-20180211
Search Terms:
- this
- object literal
Code
For the js:
console.log({
a: 1,
b() {
this
}
});
Hover over this
in b
Bug
this
has any
type
this
is properly typed in cases like:
const z = {
a: 1,
b() {
this
}
}
Playground Link:
Related Issues:
saschanaz, sterling and Josscii
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyHas ReproThis issue has compiler-backed repros: https://aka.ms/ts-reprosThis issue has compiler-backed repros: https://aka.ms/ts-reprosVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue