-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
With the following structure:
node_modules/a/default.d.tscontaining a typing and a functionnode_modules/a/package.jsoncontaining atypingsfield todefault.d.tssrc/default.ts' re-exporting everything fromaand exporting new functionssrc/newFunctions.tsusing thesrc/default.ts
You get "exported variable has or is using name from external module" errors when using an object:
import * as b from './default';
// Bug: This does the same thing, but in an object. It should still compile fine, but it doesn't.
export let wrap = {
findPersonById: function(id: number): b.IPerson {
return b.findPersonById(id);
}
}
However, when you don't use an object the functionality works as expected:
import * as b from './default';
// OK: Expected behavior. Since `b` exports everything from `a`, exporting `b.IPerson` is fine.
export function wrapFindPersonById(id: number): b.IPerson {
return b.findPersonById(123);
}
Using 1.8.0-dev.20151204. Full repo https://github.com/Deathspike/typescript-reference-bug-example/
zpdDG4gta8XKpMCd, trshafer, frederickfogerty, cronon, squeral and 18 more
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