[Issue 6668] New: Wrong "to" conversion stack trace

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 14 11:18:23 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6668

           Summary: Wrong "to" conversion stack trace
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2011-09-14 11:18:05 PDT ---
D2 code:


import std.conv;
void main() {
    to!uint("-1");
}



With DMD 2.055 it gives a strange stack trace on Windows (and on one Linux),
that I am not sure is correct:


std.conv.ConvException at ...\src\phobos\std\conv.d(1809): Can't convert value
`-1' of type string to type uint
----------------
...\src\phobos\std\conv.d(1810): uint std.conv.parse!(uint,
immutable(char)[]).parse(ref immutable(char)[])
...\src\phobos\std\conv.d(1643): uint std.conv.toImpl!(uint,
immutable(char)[]).toImpl(immutable(char)[])
...\src\phobos\std\conv.d(234): uint
std.conv.to!(uint).to!(immutable(char)[]).to(immutable(char)[])
...\test.d(3): _Dmain
----------------
std.conv.ConvException at ...\src\phobos\std\conv.d(1640): Can't convert value
`-1' of type string to type uint
----------------
...\src\phobos\std\conv.d(1640): uint std.conv.toImpl!(uint,
immutable(char)[]).toImpl(immutable(char)[])
...\src\phobos\std\conv.d(234): uint
std.conv.to!(uint).to!(immutable(char)[]).to(immutable(char)[])
...\test.d(3): _Dmain
----------------

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list