https://issues.dlang.org/show_bug.cgi?id=21288
Issue ID: 21288
Summary: Wrong context pointer for alias this function
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
struct A
{
int p;
}
struct B
{
A a() { return A.init; }
alias a this;
}
struct C
{
void foo()
{
static assert(B.p.stringof == "p"); // Error: this for s needs to be
type B not type C
}
}
void foo()
{
static assert(B.p.stringof == "p"); // totally fine
}
--