Skip to content

Conversation

NaridaL
Copy link
Contributor

@NaridaL NaridaL commented Sep 19, 2017

when either declaration of the identifier is an enum.

Partial (?) fix for #529

@mhegazy
Copy link
Contributor

mhegazy commented Sep 19, 2017

@DanielRosenwasser can i get your input on the proposed error message here?

@microsoft microsoft deleted a comment from msftclas Sep 27, 2017
@NaridaL
Copy link
Contributor Author

NaridaL commented Jan 16, 2018

@DanielRosenwasser If you OK the message, I'll rebase the PR and we can merge it^^.

"category": "Error",
"code": 2563
},
"An enum cannot be merged with a class, interface, function, namespace or variable.": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about Enum declarations can only merge with namespace or other enum declarations.

when either declaration of the identifier is an enum.

Partial (?) fix for microsoft#529

Not sure if the new test is necessary, all the cases seem to have been covered by others tests.
@NaridaL
Copy link
Contributor Author

NaridaL commented Feb 2, 2018

@mhegazy "Enum declarations can only merge with namespace or other enum declarations." definitely seems better. I rebased and changed it.

else {
const message = target.flags & SymbolFlags.BlockScopedVariable || source.flags & SymbolFlags.BlockScopedVariable
? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0;
let message = Diagnostics.Duplicate_identifier_0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

const message = target.flags & SymbolFlags.Enum || source.flags & SymbolFlags.Enum
    ? Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declaration
    : target.flags & SymbolFlags.BlockScopedVariable || source.flags & SymbolFlags.BlockScopedVariable
        ? Diagnostics.Cannot_redeclare_block_scoped_variable_0
        : Diagnostics.Duplicate_identifier_0;

@mhegazy mhegazy merged commit 6ab5d97 into microsoft:master Feb 12, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Feb 12, 2018

thanks!

@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants