[Issue 2753] Cannot declare pointer to function returning ref

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 19 11:51:27 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=2753

--- Comment #19 from Nick Treleaven <nick at geany.org> ---
> int foo(int function() ref goo);  // ref parameter

Again, that is going to be confusing with the `return ref` attribute. (And it
looks weird having a parameter storage class not come first).

>> int goo(int ref function() foo);  // ref return in parameter

> Here, the 'ref' would be exactly the same as '*' for pointers and '[]' for
arrays in terms of how it is placed

It would be a simple fix to the problem, though it might make people think
`ref` is a type modifier.

--


More information about the Digitalmars-d-bugs mailing list