Debian Codegraph @

gcc/testsuite/gdc.test/compilable/b16483.d

raw
1 struct S
2 {
3 enum a = is(typeof(false.bar!(x => x))); // The lambda compiles
4 enum b = is(typeof(false.bar!(x => y))); // The lambda doesn't compile
5 }
6 auto bar(alias foo)(bool var)
7 {
8 return foo(var);
9 }
10 static assert(is(typeof(S.a) == bool));
11 static assert(S.a == true);
12 static assert(S.b == false);