-
Notifications
You must be signed in to change notification settings - Fork 12.8k
[Spec] Duplicate ambient external module name #52
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
Comments
Changing to spec issue. The new compiler supports merging of all module declarations, including ambient external module declarations. I see no reason why we should only allow merging of internal modules and specifically disallow merging of ambient external modules. In particular, declaration files sometimes extend existing internal modules and may want to do exactly that for ambient external modules. |
From design meeting: agreed this should merge just like internal modules. |
Leaving open so we can make the text change to the spec |
When I run this code in typescript I get
Sounds like the correct behaviour is no errors. Would be great to have an npm publish of a version with this fixed :) |
It seems like this doesn't work if the module is exported by assignment? declare module "m" {
function inner(s: string);
module inner { export interface Test {t: string;} }
export = inner //error here
}
declare module "m" {
// even though we're only extending already existing submodule
module inner { export interface Other { t: number; } }
} |
@spion The name |
@RyanCavanaugh I see. The original problem is express.d.ts https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/express/express.d.ts Here, express exposes a namespace I'll open a separate issue. |
Expected:
!!! Duplicate identifier ''fs''.
!!! Ambient external module declaration cannot be reopened.
Actual: no error
The text was updated successfully, but these errors were encountered: