Bug 19251 – Alias this does not get called on struct qualified type
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-09-18T11:06:45Z
Last change time
2018-10-01T14:08:31Z
Assigned to
No Owner
Creator
RazvanN
Comments
Comment #0 by razvan.nitu1305 — 2018-09-18T11:06:45Z
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.
Comment #1 by razvan.nitu1305 — 2018-09-18T13:05:47Z