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

--- Comment #3 from ag0aep6g <ag0ae...@gmail.com> ---
(In reply to John Colvin from comment #2)
> How about this, which the compiler is OK with:
> 
> struct A
> {
>     alias a = int;
> }
> 
> struct B
> {
>     A a;
>     alias b = a.a;
> }
> 
> I don't understand the logic that says we can't directly access compile-time
> members of `this` at struct scope but we can access compile-time members of
> member variables.

I think you're right. If we can use `a` that way, we should be able to use
`this`, too. There's also this:

----
struct A
{
    enum a = 1;
    enum b = this.a; /* no deprecation */
}
----

So DMD doesn't reject all cases of `this`. If the enum is acceptable, the alias
in the original snippet should be acceptable, too.

--

Reply via email to