You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import std.bigint: BigInt;
void main() {
auto p = new BigInt[1];
p[0] = BigInt(1); // OK
p[0] = 1; // OK
p ~= BigInt(1); // OK
p ~= 1; // Error
}
DMD 2.063beta:
test.d(7): Error: cannot append type int to type BigInt[]
The text was updated successfully, but these errors were encountered:
> p[0] = 1; // OK
This is assignment, so it works.
> p ~= 1; // Error
This would be implicit construction of a BigInt from an int.
That makes this an enhancement request for implicit construction on append.
bearophile_hugs reported this on 2013-05-03T16:43:51Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=10025
CC List
Description
import std.bigint: BigInt; void main() { auto p = new BigInt[1]; p[0] = BigInt(1); // OK p[0] = 1; // OK p ~= BigInt(1); // OK p ~= 1; // Error } DMD 2.063beta: test.d(7): Error: cannot append type int to type BigInt[]The text was updated successfully, but these errors were encountered: