D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19652 - [REG2.084] alias this chain no longer works
Summary: [REG2.084] alias this chain no longer works
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: industry, pull
Depends on:
Blocks:
 
Reported: 2019-02-05 21:29 UTC by johanengelen
Modified: 2019-02-18 23:32 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description johanengelen 2019-02-05 21:29:10 UTC
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
Comment 1 Seb 2019-02-16 10:58:33 UTC
There's a PR at DMD:

https://github.com/dlang/dmd/pull/9334
Comment 2 Dlang Bot 2019-02-18 22:17:34 UTC
@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 Dlang Bot 2019-02-18 23:32:35 UTC
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