Thread overview
[Issue 17190] [REG2.072] isNumeric!string conflict std.traits std.string
February 16
https://issues.dlang.org/show_bug.cgi?id=17190

Jonathan M Davis <issues.dlang@jmdavisProg.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |issues.dlang@jmdavisProg.co
                   |                            |m

--- Comment #1 from Jonathan M Davis <issues.dlang@jmdavisProg.com> ---
It's a side effect of std.string.isNumeric being templatized in 2.072 to work with ranges rather than just strings. Before, it wasn't a template, so there was no ambiguity. Now it is a template, so the two symbols are ambiguous. It's unfortunate that it's caused problems, but it's not a bug. The only fix would be to change one of their names, but that would then break any code that used them. That being said, having a symbol that's an eponymous template have the same name as a symbol that's a function is bad planning, because they won't overload. Any code that imports both will have to either import one with a different name, or it will need to use the full import path when using them.

--
February 20
https://issues.dlang.org/show_bug.cgi?id=17190

Johan Engelen <jbc.engelen@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |industry

--
April 27
https://issues.dlang.org/show_bug.cgi?id=17190

b2.temp@gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp@gmx.com

--- Comment #2 from b2.temp@gmx.com ---
option 1/

Renaming with deprecation is not like breaking:

bool isNumber(S)(S s, bool bAllowSep = false) {}
deprecated("use isNumber instead, ...") alias isNumeric = isNumber;


option 2/

there's a simple fix, but it's not particularly nice:

bool isNumeric(S, T = void)(S s){return false;}
enum isNumeric(S) = true;
static assert(isNumeric!string);
static assert(!isNumeric("sdf"));

--