Bug 16418 – dip25 wrong escaping reference to this

Status
RESOLVED
Resolution
INVALID
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-08-23T09:44:00Z
Last change time
2016-10-15T13:06:51Z
Assigned to
nobody
Creator
john.loughran.colvin

Comments

Comment #0 by john.loughran.colvin — 2016-08-23T09:44:08Z
when compiling with -dip25 struct S(things...) { ref foo(newThings...)() { alias NewT = S!(things, newThings); return *(() => cast(NewT*)&this)(); } } void main() { S!float s; auto s1 = s.foo!(int); //OK auto s2 = s.foo!(); //Error escaping reference to this } worked fine in 2.071.2-b1, fails with current git HEAD
Comment #1 by john.loughran.colvin — 2016-08-23T11:04:16Z
removing the cast makes the "//OK" one fail as well, with the same error.
Comment #2 by github-bugzilla — 2016-09-20T00:23:40Z
Commit pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/21d65b6a23d8176c9479fb957f5d317916186de8 test typecons.Tuple.rename for sucessful no-ops, working around bug 16418
Comment #3 by github-bugzilla — 2016-10-01T11:47:12Z
Commit pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/21d65b6a23d8176c9479fb957f5d317916186de8 test typecons.Tuple.rename for sucessful no-ops, working around bug 16418
Comment #4 by bugzilla — 2016-10-13T23:00:33Z
It is an escaping reference to this. Compiler is working as intended.
Comment #5 by john.loughran.colvin — 2016-10-15T13:06:51Z
What about the inconsistency between the two different cases?