Skip to content

Commit bd543a6

Browse files
committed
Issue 17712: Add toChars workaround for toImpl
https://issues.dlang.org/show_bug.cgi?id=17712#c11
1 parent ddb2d87 commit bd543a6

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

std/conv.d

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,8 +1435,10 @@ do
14351435
switch (radix)
14361436
{
14371437
case 10:
1438+
// workaround https://issues.dlang.org/show_bug.cgi?id=17712#c12
1439+
enum ten = 10;
14381440
// The (value+0) is so integral promotions happen to the type
1439-
return toChars!(10, EEType)(value + 0).array;
1441+
return toChars!(ten, EEType)(value + 0).array;
14401442
case 16:
14411443
// The unsigned(unsigned(value)+0) is so unsigned integral promotions happen to the type
14421444
if (letterCase == letterCase.upper)
@@ -6282,8 +6284,8 @@ private auto hexStrLiteral(String)(scope String hexData)
62826284
* Returns:
62836285
* Random access range with slicing and everything
62846286
*/
6285-
6286-
auto toChars(ubyte radix = 10, Char = char, LetterCase letterCase = LetterCase.lower, T)(T value)
6287+
// radix was ubyte, changed to workaround https://issues.dlang.org/show_bug.cgi?id=17712#c11
6288+
auto toChars(alias radix = 10, Char = char, LetterCase letterCase = LetterCase.lower, T)(T value)
62876289
pure nothrow @nogc @safe
62886290
if ((radix == 2 || radix == 8 || radix == 10 || radix == 16) &&
62896291
(is(Unqual!T == uint) || is(Unqual!T == ulong) ||

0 commit comments

Comments
 (0)