[Issue 14128] AliasDeclaration allows expressions, causing false code for ThisExp

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 21 20:58:34 UTC 2023


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

Nick Treleaven <nick at geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick at geany.org

--- Comment #4 from Nick Treleaven <nick at geany.org> ---
These declarations all alias the same symbol:

        alias a = this.v;
        alias b = that.v;
        alias c = Foo.v;
        alias d = v;

`a` and `b` resolve at compile-time to `v` based on the *type* of `this` (or
`that`). The use of an alias of `v` then resolves at runtime to `this.v`.

I agree that `a` and `b` look like they are binding to runtime fields.

--


More information about the Digitalmars-d-bugs mailing list