Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions std/conv.d
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ T toImpl(T, S)(S value)
if ( isExactSomeString!S && isDynamicArray!S &&
!isExactSomeString!T && is(typeof(parse!T(value))))
{
scope(exit)
scope(success)
{
if (value.length)
{
Expand All @@ -1623,7 +1623,7 @@ T toImpl(T, S)(S value, uint radix)
if ( isExactSomeString!S && isDynamicArray!S &&
!isExactSomeString!T && is(typeof(parse!T(value, radix))))
{
scope(exit)
scope(success)
{
if (value.length)
{
Expand All @@ -1633,6 +1633,13 @@ T toImpl(T, S)(S value, uint radix)
return parse!T(value, radix);
}

unittest
{
// Issue 6668 - ensure no collaterals thrown
try { to!uint("-1"); }
catch (ConvException e) { assert(e.next is null); }
}

unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
Expand Down