D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6676 - Optimize error std.conv.to!int(const(char[]))
Summary: Optimize error std.conv.to!int(const(char[]))
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 All
: P2 normal
Assignee: No Owner
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2011-09-15 05:03 UTC by Takuya Kurosawa
Modified: 2012-02-23 04:42 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Takuya Kurosawa 2011-09-15 05:03:46 UTC
dmd 2.055

Code
--------
import std.conv;

void main()
{
	const(char[]) number = "12345";
	to!int(number);
}
--------


build & run
--------
dmd test.d
./test
dmd -O test.d
./test
std.conv.ConvException@C:\dmd2\windows\bin\..\..\src\phobos\std\conv.d(1640): Can't convert value `12345' of type const(char)[] to type int
--------
Comment 1 yebblies 2012-02-23 00:55:15 UTC
I can't reproduce this with 2.058.  Anyone?
Comment 2 bearophile_hugs 2012-02-23 04:42:45 UTC
It seems to work now.