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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Oct 8 19:49:57 PDT 2015


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

--- Comment #7 from Walter Bright <bugzilla at digitalmars.com> ---
(In reply to Kenji Hara from comment #5)
> (In reply to Kenji Hara from comment #3)
> > Because today, two different alias declarations aliasing an identical type
> > are allowed if they're accessed beyond the import boundaries.
> 
> Identical symbol aliases are also allowed via imports.

That's right, and that must be supported, because one doesn't necessarily
control the declarations in imports.

> So, I think the
> following case would also need to be supported.
> 
> int a15167;
> alias Var15167 = a15167;
> alias Var15167 = a15167;
> 
> void f15167() {}
> alias Foo15167 = f15167;
> alias Func15167 = Foo15167;
> alias Func15167 = f15167;

I don't believe that follows, and I can't think of a valid use case for it that
doesn't look like a bug. Note that one does always control the declarations
within a module, so there's no reason to allow this.

--


More information about the Digitalmars-d-bugs mailing list