| 1 |
module b20875; |
| 2 |
|
| 3 |
/* |
| 4 |
TEST_OUTPUT: |
| 5 |
--- |
| 6 |
fail_compilation/b20875.d(10): Error: template instance `Foo!int` does not match template declaration `Foo(alias T : None!U, U...)` |
| 7 |
fail_compilation/b20875.d(10): while evaluating: `static assert(Foo!int)` |
| 8 |
fail_compilation/b20875.d(11): Error: template instance `Bar!int` does not match template declaration `Bar(alias T : None!U, U...)` |
| 9 |
fail_compilation/b20875.d(11): while evaluating: `static assert(!Bar!int)` |
| 10 |
fail_compilation/b20875.d(14): Error: template parameter specialization for a type must be a type and not `NotAType()` |
| 11 |
fail_compilation/b20875.d(15): while looking for match for `Baz!int` |
| 12 |
fail_compilation/b20875.d(15): while evaluating: `static assert(!Baz!int)` |
| 13 |
--- |
| 14 |
*/ |
| 15 |
|
| 16 |
#line 7 |
| 17 |
|
| 18 |
enum Foo(alias T : None!U, U...) = true; |
| 19 |
enum Bar(alias T : None!U, U...) = false; |
| 20 |
static assert( Foo!(int)); |
| 21 |
static assert(!Bar!(int)); |
| 22 |
|
| 23 |
template NotAType(){} |
| 24 |
enum Baz(alias T : NotAType) = false; |
| 25 |
static assert(!Baz!(int)); |
| 26 |
|
| 27 |
void main(){} |