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

[REG2.069-devel] Issue 15167 - conflicting error with repeated alias declaration #5169

Closed
wants to merge 6 commits into from

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Oct 8, 2015

https://issues.dlang.org/show_bug.cgi?id=15167

Allow identical type aliases.

The refactoring commits are cherry-picked from #5009.

If an error happens during the overloads connection, it's not part of
the alias declaration. It exists between two symbols, and essentially it
belongs to the enclosing scope symbol.
@9rnsr
Copy link
Contributor Author

9rnsr commented Oct 8, 2015

Also support identical symbol aliases.

@MartinNowak
Copy link
Member

Also support identical symbol aliases.

I'm not too sure we actually want to allow this. At least I don't see a use case for "overloaded" variables so making an exception for identical aliases is a bit odd.

@9rnsr
Copy link
Contributor Author

9rnsr commented Oct 9, 2015

@MartinNowak The main idea of this PR is "if identical aliases are repeated, it's allowed". If we allow it for types, I think it should also be allowed for symbols. It's rather consistent rule application.

And, such the repetition may happen unintentionally. If the aliased variable is defined as a callable entity, the alias repetitions will be looked like an overload merge of function symbols.

If we disallow repetitions identical aliases for symbols, why we need allow them for types? We should go either way "allow all repetitions of identical aliases" or "disallow such repetitions properly as a language spec (make issue 15167 invalid)".

@9rnsr
Copy link
Contributor Author

9rnsr commented Oct 9, 2015

@9rnsr
Copy link
Contributor Author

9rnsr commented Oct 9, 2015

I've got Walter's answer in bugzilla, and it's make sense to me.
https://issues.dlang.org/show_bug.cgi?id=15167#c7

@9rnsr 9rnsr closed this Oct 9, 2015
@9rnsr 9rnsr deleted the fix15167 branch October 11, 2015 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants