Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespaces not merged from UMD globals #9329

Open
RyanCavanaugh opened this issue Jun 23, 2016 · 2 comments
Open

Namespaces not merged from UMD globals #9329

RyanCavanaugh opened this issue Jun 23, 2016 · 2 comments
Labels
Bug A bug in TypeScript
Milestone

Comments

@RyanCavanaugh
Copy link
Member

a.d.ts

export = ns;

export as namespace ns;

declare namespace ns {
  export var x: number;
  export interface IFoo { }
}

b.d.ts

declare namespace ns.something {
  export var p: ns.IFoo;
}

tsc a.d.ts b.d.ts

Expected: No error
Actual: Error that ns has no member IFoo (because the ns UMD global gets shadowed rather than merged)

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Jun 23, 2016
@RyanCavanaugh RyanCavanaugh self-assigned this Jun 23, 2016
@RyanCavanaugh RyanCavanaugh removed their assignment Jun 23, 2016
@RyanCavanaugh
Copy link
Member Author

Talked with @mhegazy and we think this might be the behavior we want anyway -- b.d.ts should convert to UMD or module augmentation

@mhegazy mhegazy modified the milestones: Future, TypeScript 2.1 Sep 29, 2016
@mhegazy mhegazy assigned ghost and unassigned RyanCavanaugh Aug 31, 2017
@mhegazy mhegazy removed this from the Future milestone Aug 31, 2017
@mhegazy mhegazy added this to the TypeScript 2.9 milestone Apr 12, 2018
@ghost
Copy link

ghost commented Jun 18, 2018

It looks like this was done intentionally in #10354, which makes the export as namespace take no effect if there is already a global (which there is, from b.d.ts). @RyanCavanaugh @mhegazy Can this be closed?

@mhegazy mhegazy modified the milestones: TypeScript 3.0, Future Jul 2, 2018
@RyanCavanaugh RyanCavanaugh unassigned ghost Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants