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

Philpax <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #6 from Philpax <[email protected]> ---
My use-case for this was implementing a toString function for different types
in my view template (i.e. embedded D in a display layout) code. Without it, I
had to name each variant of the function something unique, which led to
function names like toStringSerializeNode(serializeNode) and
toStringDeserializeNode(deserializeNode) before I switched to the suggested
static struct solution.

As was mentioned, this would also be helpful in unit tests and other areas in
which helper functions for multiple types would be convenient. I personally
believe it's incongruous to not support overloading in local scope; D treats
local functions similarly to global functions in all the cases I've
encountered, but this seems like one case where the behaviour doesn't match up.

--

Reply via email to