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

39 lines
507 B
D

/*
TEST_OUTPUT:
---
fail_compilation/diag11727.d(10): Error: type `n` is not an expression
---
*/
auto returnEnum()
{
enum n;
return n;
}
void main()
{
assert(returnEnum() == 0);
}
/*
TEST_OUTPUT:
---
fail_compilation/diag11727.d(26): Error: type `void` is not an expression
---
*/
auto returnVoid()
{
alias v = void;
return v;
}
/*
TEST_OUTPUT:
---
fail_compilation/diag11727.d(38): Error: template `t()` has no type
---
*/
auto returnTemplate()
{
template t() {}
return t;
}