Closed
Description
🔎 Search Terms
exported variable has or is using private name
🕗 Version & Regression Information
- 4.1.2
- 4.2.2
didn't verify other versions
💻 Code
main.ts
export const x = add(import("./sub"));
export * as Q from "./sub";
declare function add<T>(x: Promise<T>): T;
sub.ts
export function a() {}
tsconfig.json
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"declaration": true
}
}
run
tsc
🙁 Actual behavior
main.ts:1:14 - error TS4025: Exported variable 'x' has or is using private name 'Q'.
1 export const x = add(import("./sub"));
🙂 Expected behavior
No error. If I remove the export * as Q from './sub'
it will generate
export declare const x: typeof import("./sub");