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