-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Alternative proposal for grouping exported and local declarations #197
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
Conversation
@@ -518,6 +518,10 @@ | |||
"category": "Error", | |||
"code": 2190 | |||
}, | |||
"All declarations of merged declaration '{0}' must be exported or not exported.": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took me a minute to understand this message - if we reported this, people would think we found a way to break the law of the excluded middle.
I might go with
A declaration of '{0}' must be consistent with its other declarations in their export behavior.
or use the following two messages
A merging declaration of '{0}' must be exported to be consistent with its other declarations.
A merging declaration of '{0}' must not be exported to be consistent with its other declarations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the problem is the scope ambiguity. If 'All' takes wide scope, it is a tautology.
How about: "Individual declarations in a merged declaration must be all exported or all local.
I like Daniel's suggestions too
Strict mode support
// we use SymbolFlags.ExportValue, SymbolFlags.ExportType and SymbolFlags.ExportNamespace | ||
// to denote disjoint declarationSpaces (without making new enum type). | ||
var declarationSpaces: SymbolFlags = 0; | ||
var hasExport: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just make this false?
Also, can you make this symbolHasExport
?
@ahejlsberg do you have any comments or notes? |
👍 |
Alternative proposal for grouping exported and local declarations
This is another version of grouping exported and locals declarations (originally proposed as #37).
Implementation notes: