mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
25 lines
435 B
D
25 lines
435 B
D
// REQUIRED_ARGS: -o-
|
|
|
|
int sx;
|
|
double sy;
|
|
|
|
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail13336b.d(16): Error: cannot `ref` return expression `cast(double)sx` because it is not an lvalue
|
|
fail_compilation/fail13336b.d(24): Error: cannot `ref` return expression `cast(double)sx` because it is not an lvalue
|
|
---
|
|
*/
|
|
ref f1(bool f)
|
|
{
|
|
if (f)
|
|
return sx;
|
|
return sy;
|
|
}
|
|
|
|
ref f2(bool f)
|
|
{
|
|
if (f)
|
|
return sy;
|
|
return sx;
|
|
}
|