gcc/testsuite/gdc.test/compilable/test21753.d
raw| 1 | // https://issues.dlang.org/show_bug.cgi?id=21753 |
| 2 | |
| 3 | struct Sample { |
| 4 | int function() func1; |
| 5 | int function() func2; |
| 6 | } |
| 7 | |
| 8 | void noth(Sample smpl)() { |
| 9 | static assert(smpl.func1() == 0); |
| 10 | static assert(smpl.func2() == 1); |
| 11 | } |
| 12 | |
| 13 | void main() { |
| 14 | enum s = Sample( |
| 15 | { return 0; }, |
| 16 | { return 1; } |
| 17 | ); |
| 18 | static assert(s.func1() == 0); |
| 19 | static assert(s.func2() == 1); |
| 20 | noth!(s)(); |
| 21 | } |