diff options
Diffstat (limited to 'gcc/testsuite/gdc.test/runnable/test19251.d')
-rw-r--r-- | gcc/testsuite/gdc.test/runnable/test19251.d | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/runnable/test19251.d b/gcc/testsuite/gdc.test/runnable/test19251.d new file mode 100644 index 00000000000..9e0b9d4f083 --- /dev/null +++ b/gcc/testsuite/gdc.test/runnable/test19251.d @@ -0,0 +1,20 @@ +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"); +} |