https://issues.dlang.org/show_bug.cgi?id=16418
Issue ID: 16418
Summary: dip25 wrong escaping reference to this
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
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
--