-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScript
Milestone
Description
TypeScript Version: 4.0.0-dev.20200512
Search Terms: implements, jsdoc, declaration
Code
file.js:
/**
* @implements {Global.Dispatcher}
*/
export class Dispatcher {
foobar() {
return 42;
};
}defs.d.ts:
declare namespace Global {
export interface Dispatcher {
foobar(): number;
}
}tsconfig.json:
{
"compilerOptions": {
"module": "esnext",
"target": "esnext",
"outDir": "lib",
"declaration": true,
"allowJs": true,
"checkJs": true
},
"files": [
"file.js",
"defs.d.ts"
]
}Expected behavior:
Output declaration file file.d.ts:
/**
* @implements {Global.Dispatcher}
*/
export class Dispatcher implements Global.Dispatcher {
foobar(): number;
}
export {};Actual behavior:
declare const Dispatcher_base: undefined;
/**
* @implements {Global.Dispatcher}
*/
export class Dispatcher implements Dispatcher_base {
foobar(): number;
}
export {};The syntax in this declaration file is broken and shows the following error:
'Dispatcher_base' refers to a value, but is being used as a type here.ts(2749)
Playground Link: n/a
Related Issues: #35629 implemented in #36292 CC @sandersn @dragomirtitian
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScript