-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
TypeScript Version:
1.8.10 / nightly (1.9.0-dev.20160515)
Code
// file ThingA.ts
export class ThingA { }
// file ThingB.ts
export class ThingB { }
// file Things.ts (re-export)
export {ThingA} from "./ThingA";
export {ThingB} from "./ThingB";
// file Test.ts (uses re-exported classes)
import * as things from "./Things";
export class Test {
public method = (input: things.ThingA) => { };
}
// compile
tsc Test.ts --declaration --outDir compiledExpected behavior:
No errors
Actual behavior:
Test.ts(5,5): error TS4029: Public property 'method' of exported class has or is using name 'ThingA' from external module ".../ThingA" but cannot be named.
It seems declaration file can't be generated due to the things.ThingA reference, but in a similar case without re-exporting it works fine (I will give an example of this in the next post).
If I change the import statement in Test.ts to this:
import {ThingA,ThingB} from "./Things";(instead of import * as things) and further use ThingA directly, there are no errors, but this defeats the purpose of re-exporting.
robyoder, jshamley, monolithed, ktutnik and imaheshbabu
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created