-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptWorking as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Milestone
Description
From @shivshankar3578 on March 24, 2018 11:9
mod.js
/**
* @module mod
*/
/**
* @typedef {Object} foobar
* @property {String} foo
* @property {Boolean} [bar] - Optional value
*/
/**
*
*
* @param {string} foo
* @param {string} bar
* @return {foobar}
*/
function doSomething (foo, bar) {
console.log(foo, bar);
// do something
return {
foo : foo,
bar : bar
}
}
let n = doSomething('a', 'b');
module.exports = doSomething;
jsdoc.js
const mod = require('./mod');
let n = new mod('a', 'b');
console.log(n)
pic-1 n:foobar
then why n:any here
while imported module have foobar return type
Copied from original issue: microsoft/vscode#46463
SalvatorePreviti
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptWorking as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug