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