gcc/testsuite/gdc.test/compilable/test16037.d
raw| 1 | /* REQUIRED_ARGS: -preview=dip1000 |
| 2 | */ |
| 3 | |
| 4 | // https://issues.dlang.org/show_bug.cgi?id=16037 |
| 5 | |
| 6 | @safe: |
| 7 | |
| 8 | void testXXX () @nogc |
| 9 | { |
| 10 | Object o; |
| 11 | scope bool delegate (Object) alwaysFalse = (Object y) { return false; }; |
| 12 | scope c1 = o !is null ? (Object y) { return o is y; } : alwaysFalse; |
| 13 | } |
| 14 | |
| 15 | auto f() @nogc |
| 16 | { |
| 17 | int a; |
| 18 | void g(){ a=1; } |
| 19 | scope h=&g; |
| 20 | h(); |
| 21 | } |