Closed
Description
TypeScript Version: 4.0.3
Search Terms:
unique symbol, declaration, .d.ts, invalid, TS4023
Code
a.ts
type AX = { readonly A: unique symbol };
export const A: AX = 0 as any;
b.ts
import { A } from './a';
export const A1 = A;
tsconfig.json
{
"compilerOptions": {
"declaration": true,
"strict": true,
"noImplicitAny": true,
"rootDir": "src",
"outDir": "lib"
}
}
Expected behavior:
Typescript should either throw TS4023, or generate the following code for b.d.ts:
import { A } from './a';
export declare const A1: typeof A;
Actual behavior:
Typescript generates "unique symbol" to both a.d.ts and b.d.ts:
a.d.ts
declare type AX = {
readonly A: unique symbol;
};
export declare const A: AX;
export {};
b.d.ts
export declare const A1: {
readonly A: unique symbol;
};
Project Link:
project.zip