gcc/testsuite/gdc.dg/pr111650.d
raw| 1 | // { dg-do compile } |
| 2 | ref V require(K, V)(ref V[K] aa, K key, lazy V value); |
| 3 | |
| 4 | struct Root |
| 5 | { |
| 6 | ulong[3] f; |
| 7 | } |
| 8 | |
| 9 | Root[ulong] roots; |
| 10 | |
| 11 | Root getRoot(int fd, ulong rootID) |
| 12 | { |
| 13 | return roots.require(rootID, |
| 14 | { |
| 15 | Root result; |
| 16 | inoLookup(fd, () => result); |
| 17 | return result; |
| 18 | }()); |
| 19 | } |
| 20 | |
| 21 | void inoLookup(int, scope Root delegate()) { } |