Thread overview | |||||
---|---|---|---|---|---|
|
December 17, 2022 [Issue 20595] there should be a way to suggest that `auto` return will only be of certain types | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20595 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P1 |P4 -- |
March 31, 2023 [Issue 20595] there should be a way to suggest that `auto` return will only be of certain types | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20595 Nick Treleaven <nick@geany.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@geany.org --- Comment #1 from Nick Treleaven <nick@geany.org> --- You can already do this with an OutStatement with a static assert: auto f() out (r) { static assert(is(typeof(r) : int)); } do { return ""; } Compiling this you get an error, and the out contract should/could be shown in the docs (haven't checked). -- |
October 24, 2023 [Issue 20595] there should be a way to suggest that `auto` return will only be of certain types | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20595 Basile-z <b2.temp@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://issues.dlang.org/sh | |ow_bug.cgi?id=24197 -- |
Copyright © 1999-2021 by the D Language Foundation