mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
20 lines
309 B
D
20 lines
309 B
D
string result;
|
|
|
|
struct A
|
|
{
|
|
int[] a;
|
|
immutable(A) fun()
|
|
{
|
|
result ~= "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)
|
|
assert(result == "Yo");
|
|
}
|