[Issue 24717] alias edge cases with tupleof

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 31 09:46:21 UTC 2024


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

Nick Treleaven <nick at geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |normal

--- Comment #5 from Nick Treleaven <nick at geany.org> ---
> That is because an alias declaration cannot target a value.

Sorry, s.x can be aliased as a symbol. 

    alias y = s.tupleof[0]; // error
    alias x = s.x; // OK
    x.writeln; // error, no instance of S - correct by design

So there is a bug, the `y` alias should work like `x`.

--


More information about the Digitalmars-d-bugs mailing list