www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15695] New: Wrong error message in failed conversion from

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

          Issue ID: 15695
           Summary: Wrong error message in failed conversion from string
                    to int
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: hsteoh quickfur.ath.cx

Code:
------
import std.conv;
void main() {
    int i = " 12".to!int;
}
------

Output:
------
Unexpected '1' when converting from type string to type int
------

The error message should be pointing to ' ' as the unexpected character, not
'1'.

--
Feb 17 2016