mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
12 lines
308 B
D
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);
|