Comment #0 by Jesse.K.Phillips+D — 2014-02-25T19:56:51Z
The following program will throw an exception on the second read.
------
void main()
{
import std.stdio;
int input;
readf("%s", &input);
readf("%s", &input);
}
------
The exceptions message points out the remaining newline from the first input:
--------
conv.d(1901): Unexpected '
' when converting from type LockingTextReader to type int
--------
It should probably convert whitespace into a more recognizable form:
-------
conv.d(1901): Unexpected '\n' when converting from type LockingTextReader to type int
-------
Comment #1 by dave — 2015-05-09T09:30:34Z
Current version of d 2.67.1 will skip the \n, for example the program...
------
void main()
{
import std.stdio;
int input;
readf("%s", &input);
readf("%s", &input);
}
------
Given the input...
------
1
2
------
Will emit the error...
------
std.conv.ConvException@/usr/include/dlang/dmd/std/conv.d(2013): Unexpected '2' when converting from type LockingTextReader to type int
------
Comment #2 by dlang-bugzilla — 2017-07-18T13:04:00Z
*** Issue 15297 has been marked as a duplicate of this issue. ***
Comment #3 by github-bugzilla — 2017-07-31T15:37:18Z