| 1 |
|
| 2 |
|
| 3 |
/**************************************/ |
| 4 |
// https://issues.dlang.org/show_bug.cgi?id=6538 |
| 5 |
|
| 6 |
template allSatisfy(alias F, T...) { enum bool allSatisfy = true; } |
| 7 |
template isIntegral(T) { enum bool isIntegral = true; } |
| 8 |
|
| 9 |
void foo(I...)(I sizes) |
| 10 |
if (allSatisfy!(isIntegral, sizes)) {} |
| 11 |
|
| 12 |
void test6538a() |
| 13 |
{ |
| 14 |
foo(42, 86); |
| 15 |
} |
| 16 |
|
| 17 |
void bar(T1, T2)(T1 t1, T2 t2) |
| 18 |
if (allSatisfy!(isIntegral, t1, t2)) {} |
| 19 |
|
| 20 |
void test6538b() |
| 21 |
{ |
| 22 |
bar(42, 86); |
| 23 |
} |
| 24 |
|
| 25 |
/**************************************/ |
| 26 |
// https://issues.dlang.org/show_bug.cgi?id=9361 |
| 27 |
|
| 28 |
template Sym(alias A) |
| 29 |
{ |
| 30 |
enum Sym = true; |
| 31 |
} |
| 32 |
|
| 33 |
struct S |
| 34 |
{ |
| 35 |
void foo()() if (Sym!(this)) {} |
| 36 |
void bar()() { static assert(Sym!(this)); } // OK |
| 37 |
} |
| 38 |
void test9361a() |
| 39 |
{ |
| 40 |
S s; |
| 41 |
s.foo(); // fail |
| 42 |
s.bar(); // OK |
| 43 |
} |