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

[spec] AmbientExternalModuleDeclaration missing "declare"? #1176

Closed
yortus opened this issue Nov 16, 2014 · 1 comment · Fixed by #1878
Closed

[spec] AmbientExternalModuleDeclaration missing "declare"? #1176

yortus opened this issue Nov 16, 2014 · 1 comment · Fixed by #1878
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Spec Issues related to the TypeScript language specification

Comments

@yortus
Copy link
Contributor

yortus commented Nov 16, 2014

The grammar in Appendix A of the spec does not appear to allow the syntax:

declare module "foo" {
   //...
}

In particular, the grammar does not appear to allow the keyword declare to immediately precede the module keyword in the AmbientExternalModuleDeclaration production rule or any usage thereof. The compiler, however, does require the declare to be present. Am I missing something?

@yortus yortus changed the title Language Specification: AmbientExternalModuleDeclaration missing "declare"? [spec] AmbientExternalModuleDeclaration missing "declare"? Nov 16, 2014
@mhegazy mhegazy added Bug A bug in TypeScript Spec Issues related to the TypeScript language specification labels Nov 16, 2014
@CyrusNajmabadi
Copy link
Contributor

I believe @yortus is correct. 'Declare' is not allowed as per spec. However, that likely not what we want given:

  1. We use declare module 'str' all over the spec.
  2. The old compiler would literally complain if you had module 'str' and did not have the declare keyword.

@ahejlsberg ahejlsberg self-assigned this Nov 17, 2014
@billti billti added this to the TypeScript 1.4 milestone Nov 21, 2014
@ahejlsberg ahejlsberg added the Fixed A PR has been merged for this issue label Feb 2, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Spec Issues related to the TypeScript language specification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants