https://issues.dlang.org/show_bug.cgi?id=19251
Issue ID: 19251
Summary: Alias this does not get called on struct qualified
type
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
struct A
{
int[] a;
immutable(A) fun()
{
writeln("Yo");
return immutable A([7]);
}
alias fun this;
}
void main()
{
A a;
immutable A b = a; // error: cannot implicitly convert expression a of
type A to immutable(A)
}
This code should print YO.
--