TypeScript/tests/cases/compiler/moduleAugmentationDoesNamespaceMergeOfReexport.ts
Wesley Wigham 15aff05ff6
Explicitly merge module augmentation members into the exports added by export * declarations (#37691)
* Explicitly merge module augmentation members into the exports added by export * declarations

* Use ?., add namespace merge test

* Add missing merged symbol call to handle enum/ns merges during entity name lookup

* Add test with error case

* Handle missing value declarations in more places, unify duplicate declaration error handling to improve assignment declaration duplicate errors
2020-04-01 16:36:28 -07:00

25 lines
431 B
TypeScript

// @filename: file.ts
export namespace Root {
export interface Foo {
x: number;
}
}
// @filename: reexport.ts
export * from "./file";
// @filename: augment.ts
import * as ns from "./reexport";
declare module "./reexport" {
export namespace Root {
export interface Foo {
self: Foo;
}
}
}
declare const f: ns.Root.Foo;
f.x;
f.self;
f.self.x;
f.self.self;