Bug 19883 – Cyclic constructor call for BigInt(dstring)

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-05-18T14:29:52Z
Last change time
2020-03-21T03:56:38Z
Keywords
pull
Assigned to
No Owner
Creator
Sophie

Comments

Comment #0 by meapineapple — 2019-05-18T14:29:52Z
Expected behavior: BigInt can be initialized with a string, wstring, or dstring. Actual behavior: Attempting to initialize BigInt (std.bigint) with a dstring produces an error. Example repro case: C:\D\dmd.2.081.2\dmd2\windows\bin\..\..\src\phobos\std\bigint.d(122): Error: cyclic constructor call E:\...\test.d(3): Error: template instance `std.bigint.BigInt.__ctor!dstring` error instantiating void main() { import std.bigint; auto n = BigInt("1234"d); }
Comment #1 by b2.temp — 2019-05-19T02:29:29Z
The problem is that byCodeUnit over dchar[] verifies isSomeString; import std.utf, std.traits; dchar[] t; static assert(!isSomeString!(typeof(t.byCodeUnit))); So the other __ctor overload is never called.
Comment #2 by dlang-bot — 2019-05-19T02:37:17Z
@Basile-z created dlang/phobos pull request #7017 "fix issue 19883 - Cyclic constructor call for BigInt(dstring)" fixing this issue: - fix issue 19883 - Cyclic constructor call for BigInt(dstring) https://github.com/dlang/phobos/pull/7017
Comment #3 by dlang-bot — 2019-05-19T03:33:17Z
dlang/phobos pull request #7017 "fix issue 19883 - Cyclic constructor call for BigInt(dstring)" was merged into master: - 7bf6a6d0d1e9a0f51b054265e115addea572ff98 by Basile Burg: fix issue 19883 - Cyclic constructor call for BigInt(dstring) https://github.com/dlang/phobos/pull/7017