www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6668] New: Wrong "to" conversion stack trace

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: bearophile_hugs eml.cc



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 ...\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 ...\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: -------
Sep 14 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6668


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



22:13:00 PST ---
It's caused by collateral exceptions due to scope(exit) being used in std.conv
which throws it's own exception regardless of any already in flight. I think
these should actually be scope(success) instead.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 19 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6668


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
           Platform|x86                         |All
         AssignedTo|nobody puremagic.com        |andrej.mitrovich gmail.com
         OS/Version|Windows                     |All



08:31:29 PST ---
https://github.com/D-Programming-Language/phobos/pull/1081

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 20 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6668




Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/88c2c81fbcc8cbc718f1f7bdbf7da017a18a2516
Fixes Issue 6668 - Avoid throwing collateral exceptions in std.conv.to

https://github.com/D-Programming-Language/phobos/commit/8f85f6bdaa985a32773442b8dc1932e1d9796436


Issue 6668 - Avoid throwing collateral exceptions in std.conv.to

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 21 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6668


Alex Rønne Petersen <alex lycus.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |alex lycus.org
         Resolution|                            |FIXED


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