D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6258 - std.conv.to!real("-") fetches the front of an empty array.
Summary: std.conv.to!real("-") fetches the front of an empty array.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2011-07-06 07:43 UTC by Kajtek
Modified: 2011-10-13 23:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kajtek 2011-07-06 07:43:52 UTC
Instead it should throw ConvException.
Some code and versions:


import std.conv;
void main() {
    to!real("-");
    //GDC hg, using dmd 2.052 core.exception.AssertError@/.../std/array.d(373): Attempting to fetch the front of an empty array
    //DMD32 D Compiler v2.053 core.exception.AssertError@/.../std/array.d(372): Attempting to fetch the front of an empty array
    //GNU/Linux i686
}
Comment 1 Kajtek 2011-07-18 10:42:30 UTC
Happens aswell when parsing "in".

to!real("in");