| 1 |
/* REQUIRED_ARGS: |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/test16228.d(23): Error: function `test16228.S.bar` `static` member has no `this` to which `return` can apply |
| 5 |
--- |
| 6 |
*/ |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
// https://issues.dlang.org/show_bug.cgi?id=16228 |
| 12 |
|
| 13 |
int* wrap ( return ref int input ) |
| 14 |
{ |
| 15 |
return &input; |
| 16 |
} |
| 17 |
|
| 18 |
struct S |
| 19 |
{ |
| 20 |
int x; |
| 21 |
|
| 22 |
int foo() return { return 3; } |
| 23 |
static ref int bar() return { return x; } |
| 24 |
} |
| 25 |
|
| 26 |
|
| 27 |
// https://issues.dlang.org/show_bug.cgi?id=18963 |
| 28 |
|
| 29 |
T Identity(T)(return T t) { return t; } |
| 30 |
|
| 31 |
void bar(int i, void* p) |
| 32 |
{ |
| 33 |
Identity(p); |
| 34 |
Identity(i); |
| 35 |
} |