[Issue 15706] New: std.conv.to!int - wrong line number in exception

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Feb 19 11:26:59 PST 2016


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

          Issue ID: 15706
           Summary: std.conv.to!int - wrong line number in exception
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: gassa at mail.ru

Example program (test.d):

-----
import std.conv;
void main () {
    auto d = to !(int) ("@");
}
-----

Compiling with dmd 2.070.0 on Windows 32-bit with "dmd -g test.d", I get:

-----
std.conv.ConvException at std\conv.d(2002): Unexpected '@' when converting from
type string to type int
----------------
...
0x00408A80 in main at C:\programs\stuff\dlang\phobos-4008\test.d(7)
...
-----

The actual line number is 3, not 7.

If I compile as "dmd -O -g test.d", the reported line number is 8: wrong again,
but different.

--


More information about the Digitalmars-d-bugs mailing list