Bug 17684 – [REG 2.062] `static alias this` bug or incomplete implementation?

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-07-25T12:56:33Z
Last change time
2019-03-29T18:03:22Z
Assigned to
No Owner
Creator
Mike Franklin

Comments

Comment #0 by slavo5150 — 2017-07-25T12:56:33Z
Consider the following code: import std.stdio; struct StaticStruct { static int X; static alias X this; } struct InstanceStruct { int X; alias X this; } void main() { StaticStruct = 5; // Exhibit A: No Error int V = StaticStruct; // Exhibit B: Error: type StaticStruct has no value InstanceStruct s; s = 5; int v = s; } `static alias this` does not work in the same manner as `alias this`, only with static members. If you believe `static alias this` is not a valid feature, then Exhibit A should not compile. If you believe `static alias this` is a valid feature, then Exhibit B should compile and work. Either way it's a bug.
Comment #1 by dlang-bugzilla — 2017-07-26T10:00:00Z
This worked in 2.061, and it looks like it was broken by accident. Marking as a regression. Introduced in https://github.com/dlang/dmd/pull/1434
Comment #2 by github-bugzilla — 2017-08-03T15:37:16Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/9cdaed6e4b2259e883b6d716472516ac994e9d1e Fix Issue 17684 - [REG 2.062] static alias this Added newline at end of file https://github.com/dlang/dmd/commit/9df55228d2311e518c3fa4dfd7348facbcbcf775 Merge pull request #7055 from JinShil/stable Fix Issue 17684 - [REG 2.062] static alias this
Comment #3 by github-bugzilla — 2017-08-07T10:44:02Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/3a1ffe2928dd6fac6625934ec8c8ba358047020d Fix Issue 17684 - [REG 2.062] static alias this (Part 2) Some formatting and comments for expression.d https://github.com/dlang/dmd/commit/0ff2243ebbec39a8441203fbb3b493c9468f2605 Merge pull request #7070 from JinShil/stable Fix Issue 17684 - [REG 2.062] static alias this (Part 2) merged-on-behalf-of: Martin Nowak <[email protected]>
Comment #4 by github-bugzilla — 2017-08-16T13:20:03Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/9cdaed6e4b2259e883b6d716472516ac994e9d1e Fix Issue 17684 - [REG 2.062] static alias this https://github.com/dlang/dmd/commit/9df55228d2311e518c3fa4dfd7348facbcbcf775 Merge pull request #7055 from JinShil/stable https://github.com/dlang/dmd/commit/3a1ffe2928dd6fac6625934ec8c8ba358047020d Fix Issue 17684 - [REG 2.062] static alias this (Part 2) https://github.com/dlang/dmd/commit/0ff2243ebbec39a8441203fbb3b493c9468f2605 Merge pull request #7070 from JinShil/stable
Comment #5 by github-bugzilla — 2017-08-30T19:13:26Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/bc8d7d8b2419dcd7cb43e2ab819896fd79bb2fc0 Fix Issue 17684 - [REG 2.062] static alias this (Part 3) https://github.com/dlang/dmd/commit/c179e9c4d769506fe6cd6acd412bd5583badfb3f Merge pull request #7106 from JinShil/static_alias_this_3 Fix Issue 17684 - [REG 2.062] static alias this (Part 3)
Comment #6 by github-bugzilla — 2017-09-03T09:05:04Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/bc8d7d8b2419dcd7cb43e2ab819896fd79bb2fc0 Fix Issue 17684 - [REG 2.062] static alias this (Part 3) https://github.com/dlang/dmd/commit/c179e9c4d769506fe6cd6acd412bd5583badfb3f Merge pull request #7106 from JinShil/static_alias_this_3
Comment #7 by github-bugzilla — 2017-10-15T21:52:12Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/3fcf20a69f8f63df74e88bcde5e22d55721a1b68 Fix Issue 17684 - [REG 2.062] static alias this (Part 4) https://github.com/dlang/dmd/commit/d01519ea9b52146afd4b1f27aaedd5b12240e414 Merge pull request #7195 from JinShil/static_alias_this_pt4 Fix Issue 17684 - [REG 2.062] static alias this (Part 4)
Comment #8 by github-bugzilla — 2017-10-16T06:37:43Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/3fcf20a69f8f63df74e88bcde5e22d55721a1b68 Fix Issue 17684 - [REG 2.062] static alias this (Part 4) https://github.com/dlang/dmd/commit/d01519ea9b52146afd4b1f27aaedd5b12240e414 Merge pull request #7195 from JinShil/static_alias_this_pt4
Comment #9 by dlang-bot — 2019-02-17T00:21:32Z
dlang/dmd pull request #9369 "Fix Issue 17684 - [REG 2.062] static alias this (Part 5)" was merged: https://github.com/dlang/dmd/pull/9369
Comment #10 by dlang-bot — 2019-03-29T18:03:22Z
dlang/dmd pull request #9513 "Fix Issue 17684 - [REG 2.062] static alias this (Part 6)" was merged into master: - 15bc4f98a0fe6f20f985d2b25fcdeefab0422b34 by JinShil: Fix Issue 17684 - [REG 2.062] static alias this (Part 6) https://github.com/dlang/dmd/pull/9513