First Draft: ref For Variable Declarations
Daniel N
no at public.email
Mon Apr 15 20:48:37 UTC 2024
On Monday, 15 April 2024 at 19:21:55 UTC, Steven Schveighoffer
wrote:
>
> You also have to add `return` to the parameter, and then it
> compiles.
>
> For reference, the edited code which compiles is:
>
> ```d
> @safe ref int foo(return ref int x)
> {
> // ref int y = x;
> // return y;
> // same as:
> ref int bar(ref int x2) {
> return x2;
> }
> return bar(x);
> }
> ```
>
> -Steve
why not
```d
ref int bar(return ref int x2)
```
is it inferred for nested functions?
More information about the dip.development
mailing list