[Issue 22990] [dip1000] extended return semantics doesn't work on auto return

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 12 12:24:28 UTC 2022


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

--- Comment #3 from Dennis <dkorpel at live.nl> ---
(In reply to Walter Bright from comment #2)
> (In reply to Walter Bright from comment #1)
> > Perhaps the function can set a flag if it doesn't see any `return`
> > statements.
> 
> I don't think this is a particular problem anyway, as why would one return
> `auto` if there are no `return` statements?

To enable attribute inference on the function, or because it's a generic
function which returns based on template parameters.

I don't have a concrete use case so I don't think there's much priority to
support this, but if it's not going to be supported, then at least the
limitation should be in the specification.

--


More information about the Digitalmars-d-bugs mailing list