dmd/compiler/test/compilable/test21753.d
2022-07-09 18:53:07 +02:00

21 lines
381 B
D

// https://issues.dlang.org/show_bug.cgi?id=21753
struct Sample {
int function() func1;
int function() func2;
}
void noth(Sample smpl)() {
static assert(smpl.func1() == 0);
static assert(smpl.func2() == 1);
}
void main() {
enum s = Sample(
{ return 0; },
{ return 1; }
);
static assert(s.func1() == 0);
static assert(s.func2() == 1);
noth!(s)();
}