-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 filesFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.7.0-dev.20171212
Code
// thingA.ts
export interface ThingA { }
// thingB.ts
export interface ThingB { }
// things.ts
export { ThingA } from "./thingA";
export * from "./thingB";
// index.ts
import * as things from "./things";
export const thing1 = (param: things.ThingA) => null;
export const thing2 = (param: things.ThingB) => null;
// tsconfig.json
{
"compilerOptions": {
"declaration": true
}
}Expected behavior:
Project compiles without errors.
Actual behavior:
index.ts(3,14): error TS4023: Exported variable 'thing2' has or is using name 'ThingB' from external module "/Users/rob/Projects/tsctest/thingB" but cannot be named.
Additional information:
@weswigham fixed the following very similar issues in #19852:
- Object detection for "Exported variable
has or is using namefrom external module" #5938 - “cannot be named” when generating declarations for re-exported classes #8612
- Declaration emit for aliased exports used in export assignments is broken #19825
In fact, before his fix, line 2 of index.ts would also fail.
I've pushed this repro as a project here: https://github.com/robyoder/tsctest
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 filesFixedA PR has been merged for this issueA PR has been merged for this issue