mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
35 lines
432 B
D
35 lines
432 B
D
/* REQUIRED_ARGS: -preview=dip1000
|
|
*/
|
|
|
|
/********************************************/
|
|
|
|
// https://issues.dlang.org/show_bug.cgi?id=20416
|
|
|
|
alias P = int*;
|
|
|
|
ref P foo(return ref P);
|
|
|
|
P bar()
|
|
{
|
|
P result;
|
|
return foo(result);
|
|
}
|
|
|
|
|
|
/********************************************/
|
|
|
|
// https://issues.dlang.org/show_bug.cgi?id=20416
|
|
|
|
|
|
struct S
|
|
{
|
|
string x;
|
|
ref S foo() return;
|
|
}
|
|
|
|
|
|
S bar2()
|
|
{
|
|
S result;
|
|
return result.foo();
|
|
}
|