Skip to content

Commit

Permalink
Issue 6808 - string to BigInt using std.conv.to
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Oct 14, 2011
1 parent e2ba3bd commit b85e583
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion std/conv.d
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,18 @@ unittest
Int3 i3 = to!Int3(1);
}

// Bugzilla 6808
unittest
{
static struct FakeBigInt
{
this(string s){}
}

string s = "101";
auto i3 = to!FakeBigInt(s);
}

/// ditto
T toImpl(T, S)(S src)
if (!isImplicitlyConvertible!(S, T) &&
Expand Down Expand Up @@ -1725,7 +1737,7 @@ $(UL
*/
T toImpl(T, S)(S value)
if (isDynamicArray!S && isSomeString!S &&
!isSomeString!T)
!isSomeString!T && is(typeof({ ElementEncodingType!S[] v = value; parse!T(v); })))
{
alias ElementEncodingType!S[] SV;
static if (is(SV == S))
Expand Down

0 comments on commit b85e583

Please sign in to comment.