[Issue 12817] New: pure nothrow text(BigInt) too

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed May 28 15:45:49 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12817

          Issue ID: 12817
           Summary: pure nothrow text(BigInt) too
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: bearophile_hugs at eml.cc

In dmd 2.066alpha this compiles and runs:


void main() pure nothrow {
    import std.conv: text;
    int x = 10;
    assert(text(x) == "10");
}


While thios:

void main() pure nothrow {
    import std.bigint: BigInt;
    import std.conv: text;
    BigInt x = 10;
    assert(text(x) == "10");
}


temp.d(5,16): Error: pure function 'D main' cannot call impure function
'std.conv.text!(BigInt).text'
temp.d(5,16): Error: 'std.conv.text!(BigInt).text' is not nothrow
temp.d(1,6): Error: function 'D main' is nothrow yet may throw

--


More information about the Digitalmars-d-bugs mailing list