[Issue 23833] New: auto dereferncing does work with alias this
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Apr 10 20:15:12 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=23833
Issue ID: 23833
Summary: auto dereferncing does work with alias this
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: james.gray at remss.net
In the following code I would expect the three final lines to equivalent.
Currently only the final two compile.
```d
struct Int {
int val;
alias val this;
}
void main() {
Int* x = new Int(123);
void foo(int a) {}
foo(x);
foo(x.val);
foo(*x);
}
```
--
More information about the Digitalmars-d-bugs
mailing list