[REG2.069-devel] Issue 15167 - conflicting error with repeated alias declaration#5169
[REG2.069-devel] Issue 15167 - conflicting error with repeated alias declaration#51699rnsr wants to merge 6 commits intodlang:stablefrom
Conversation
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.
Allow identical type aliases.
|
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. |
|
@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)". |
|
I think this change would need approval by @WalterBright. |
|
I've got Walter's answer in bugzilla, and it's make sense to me. |
https://issues.dlang.org/show_bug.cgi?id=15167
Allow identical type aliases.
The refactoring commits are cherry-picked from #5009.