4 fail_compilation/test15306.d(15): Error: `immutable` delegate `test15306.main.__dgliteral2` cannot access mutable data `i`
5 fail_compilation/test15306.d(19): Error: `shared` delegate `test15306.main.__dgliteral5` cannot access non-shared data `p`
9 // https://issues.dlang.org/show_bug.cgi?id=15306
13 // immutable cannot access mutable
15 auto dg1
= delegate void() immutable { auto inner
= i
; };
17 // shared cannot access unshared
19 auto dg2
= delegate int() shared { return *p
; };
22 // unshared can access shared
25 auto dg3
= delegate int() { return *q
; };