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

12 lines
308 B
D

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);