[Issue 21674] [REG v2.086] `alias this` triggers wrong deprecation message on function call
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Feb 17 12:16:17 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=21674
--- Comment #8 from Iain Buclaw <ibuclaw at gdcproject.org> ---
What would be considered the right behaviour for statics?
---
struct Test
{
private static int _impl;
static ref int state() { return _impl; }
void check(int expected) { assert(_impl == expected); }
alias foo this;
}
struct Test2
{
Test test;
alias test this;
}
Test t;
t = 42; // foo() = 42
t.check(42);
Test2 t2;
t2 = 42; // foo() = 42;
t2.check(42);
---
Of course specs are not too specific about it. Based on the content of issue
19441, my intuition would be don't deprecate it, because we only care about the
DotVarExp cases.
--
More information about the Digitalmars-d-bugs
mailing list