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

Flag expressions in export assignments in ambient contexts as errors #17991

Closed
mhegazy opened this issue Aug 23, 2017 · 2 comments
Closed

Flag expressions in export assignments in ambient contexts as errors #17991

mhegazy opened this issue Aug 23, 2017 · 2 comments
Assignees
Labels
Breaking Change Would introduce errors in existing code Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@mhegazy
Copy link
Contributor

mhegazy commented Aug 23, 2017

declare module "foo" {
  export default 1 + 1;  // should not be allowed
}

originally reported in #16769

@weswigham
Copy link
Member

I think it's better to wait for #17831 to merge, then change export default [node] parse [node] as a type, rather than as an expression in ambient contexts. This aligns with how we allow interfaces/type aliases/etc as default exports through other means already.

@mhegazy
Copy link
Contributor Author

mhegazy commented Sep 8, 2017

based in #18339, we should add a grammar check.

@mhegazy mhegazy added Fixed A PR has been merged for this issue Breaking Change Would introduce errors in existing code labels Sep 14, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Breaking Change Would introduce errors in existing code Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

2 participants