-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Milestone
Description
TypeScript Version: 2.5.1
Code
For the JS code:
/**
* @return {Number}
*/
const f = exports.z = () => ({})
const x = f();Expected behavior:
Type of x is number
Actual behavior:
Type of x is { [x: string]: any}
If you get rid of the chained assignment and instead writeconst f= () => ({}), the types work as expected
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue