TypeScript/tests/cases/compiler/moduleAugmentationDoesNamespaceEnumMergeOfReexport.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

26 lines
464 B
TypeScript

// @filename: file.ts
export namespace Root {
// type-only NS
export interface Foo {
x: number;
}
}
// @filename: reexport.ts
export * from "./file";
// @filename: augment.ts
import * as ns from "./reexport";
declare module "./reexport" {
// Merging an enum into a type-only NS is OK
export enum Root {
A,
B,
C
}
}
declare const f: ns.Root.Foo;
const g: ns.Root = ns.Root.A;
f.x;