D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10025 - Implicit conversion for bigint array append
Summary: Implicit conversion for bigint array append
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2013-05-03 16:43 UTC by bearophile_hugs
Modified: 2024-12-13 18:06 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2013-05-03 16:43:51 UTC
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[]
Comment 1 yebblies 2013-08-02 21:27:07 UTC
>     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.
Comment 2 dlangBugzillaToGithub 2024-12-13 18:06:45 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18577

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB