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

No error for invalid module augmentation in '.d.ts' file #24307

Closed
ghost opened this issue May 21, 2018 · 2 comments
Closed

No error for invalid module augmentation in '.d.ts' file #24307

ghost opened this issue May 21, 2018 · 2 comments
Labels
By Design Deprecated - use "Working as Intended" or "Design Limitation" instead

Comments

@ghost
Copy link

ghost commented May 21, 2018

TypeScript Version: 2.9.0-dev.20180519

Code

// @Filename: /a.d.ts
export {};
declare module "invalid" {}

// @Filename: /b.ts
export {};
declare module "invalid" {}

Expected behavior:

Error in both files.

Actual behavior:

Only error in b.ts.

@ghost ghost added the Bug A bug in TypeScript label May 21, 2018
@ghost
Copy link
Author

ghost commented May 21, 2018

There is a comment in checker.ts, // do not validate names of augmentations that are defined in ambient context, added in #8200.

@mhegazy mhegazy added this to the TypeScript 3.0 milestone May 21, 2018
@mhegazy
Copy link
Contributor

mhegazy commented May 21, 2018

thanks for the reference.. i vaguely remember this issue. i guess it is by design then.

@mhegazy mhegazy added By Design Deprecated - use "Working as Intended" or "Design Limitation" instead and removed Bug A bug in TypeScript labels May 21, 2018
@mhegazy mhegazy removed this from the TypeScript 3.0 milestone May 21, 2018
@mhegazy mhegazy closed this as completed May 21, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
By Design Deprecated - use "Working as Intended" or "Design Limitation" instead
Projects
None yet
Development

No branches or pull requests

1 participant