[Issue 21288] Wrong context pointer for alias this function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 1 10:11:06 UTC 2020


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

Mathias LANG <pro.mathias.lang at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pro.mathias.lang at gmail.com

--- Comment #1 from Mathias LANG <pro.mathias.lang at gmail.com> ---
Wait, is this code even valid ?

Here in `C.foo` & `foo` you are calling `B.p`, as a shortcut for `B.a.p`, but
`a()` is not static, hence you should not be able to do that.
Indeed if you change the expression to `B.a.p` it gives you a proper error
message. So the second case is an accept-invalid, and the first case could use
with a better error message.

--


More information about the Digitalmars-d-bugs mailing list