-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts filesFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
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
ExE-Boss and uhyo
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts filesFix AvailableA PR has been opened for this issueA PR has been opened for this issue