Bug 19652 – [REG2.084] alias this chain no longer works
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-02-05T21:29:10Z
Last change time
2019-02-18T23:32:35Z
Keywords
industry, pull
Assigned to
No Owner
Creator
johanengelen
Comments
Comment #0 by johanengelen — 2019-02-05T21:29:10Z
The following code used to compile but no longer does with dmd 2.084:
```
struct Base {
int i;
}
struct A {
Base base;
alias base this;
}
struct B {
A a;
alias a this;
}
auto asGeneric(inout ref Base block) @nogc {
return █
}
B* thingie;
auto foo() {
return asGeneric(*thingie);
}
```
Error: `cast(Base)(*thingie).a` is not an lvalue and cannot be modified
@look-at-me updated dlang/dmd pull request #9334 "#19652 Fix chained alias this." fixing this issue:
- Fix Issue 19652 Fix chained alias this.
https://github.com/dlang/dmd/pull/9334
Comment #3 by dlang-bot — 2019-02-18T23:32:35Z
dlang/dmd pull request #9334 "#19652 Fix chained alias this." was merged into stable:
- b551b1a06a9050387442cd265dfd82f88ffaf944 by look-at-me:
Fix Issue 19652 Fix chained alias this.
https://github.com/dlang/dmd/pull/9334