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