digitalmars.D.learn - An unexpected string to int exception.
- Taylor Hillegeist (3/3) Feb 17 2016 I think the following error message says it all.
- Taylor Hillegeist (10/14) Feb 17 2016 Also how rude of me:
- Taylor Hillegeist (10/26) Feb 17 2016 So my error here was i was slicing too early.
- H. S. Teoh via Digitalmars-d-learn (5/33) Feb 17 2016 Please file a bug, I'll look into making a fix for it.
- =?UTF-8?Q?Ali_=c3=87ehreli?= (7/11) Feb 17 2016 I shamefully admit that I've discovered this bug months ago and tampered...
- H. S. Teoh via Digitalmars-d-learn (6/23) Feb 17 2016 [...]
- =?UTF-8?Q?Ali_=c3=87ehreli?= (4/10) Feb 17 2016 That's the shame part. :) I was so tired and trying to get things done,
- H. S. Teoh via Digitalmars-d-learn (9/21) Feb 17 2016 [...]
I think the following error message says it all. std.conv.ConvException C:\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d(2002): Unexpected '1' when converting from type string to type int I would expect that 1 would be among the group of expected items.
Feb 17 2016
On Wednesday, 17 February 2016 at 16:11:44 UTC, Taylor Hillegeist wrote:I think the following error message says it all. std.conv.ConvException C:\D\dmd2\windows\bin\..\..\src\phob s\std\conv.d(2002): Unexpected '1' when converting from type string to type int I would expect that 1 would be among the group of expected items.Also how rude of me: DMD32 D Compiler v2.070.0 code segment in question +++++ if(l.style.canFind("Heading")){ string tmp = l.style[6..$]; ON.incrementNum( to!int(tmp)); +++++
Feb 17 2016
On Wednesday, 17 February 2016 at 16:13:47 UTC, Taylor Hillegeist wrote:On Wednesday, 17 February 2016 at 16:11:44 UTC, Taylor Hillegeist wrote:So my error here was i was slicing too early. string tmp = l.style[6..$]; should have been: string tmp = l.style[7..$]; apparently std.conv parse() will say the unexpected input is not the one that caused the error but the character after. in this case "g1" only the 1 was reported.I think the following error message says it all. std.conv.ConvException C:\D\dmd2\windows\bin\..\..\src\phob s\std\conv.d(2002): Unexpected '1' when converting from type string to type int I would expect that 1 would be among the group of expected items.Also how rude of me: DMD32 D Compiler v2.070.0 code segment in question +++++ if(l.style.canFind("Heading")){ string tmp = l.style[6..$]; ON.incrementNum( to!int(tmp)); +++++
Feb 17 2016
On Wed, Feb 17, 2016 at 04:38:34PM +0000, Taylor Hillegeist via Digitalmars-d-learn wrote:On Wednesday, 17 February 2016 at 16:13:47 UTC, Taylor Hillegeist wrote:Please file a bug, I'll look into making a fix for it. T -- Insanity is doing the same thing over and over again and expecting different results.On Wednesday, 17 February 2016 at 16:11:44 UTC, Taylor Hillegeist wrote:So my error here was i was slicing too early. string tmp = l.style[6..$]; should have been: string tmp = l.style[7..$]; apparently std.conv parse() will say the unexpected input is not the one that caused the error but the character after. in this case "g1" only the 1 was reported.I think the following error message says it all. std.conv.ConvException C:\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d(2002): Unexpected '1' when converting from type string to type int I would expect that 1 would be among the group of expected items.Also how rude of me: DMD32 D Compiler v2.070.0 code segment in question +++++ if(l.style.canFind("Heading")){ string tmp = l.style[6..$]; ON.incrementNum( to!int(tmp)); +++++
Feb 17 2016
On 02/17/2016 09:09 AM, H. S. Teoh via Digitalmars-d-learn wrote:I shamefully admit that I've discovered this bug months ago and tampered with three error messages on the following page: :D http://ddili.org/ders/d.en/fibers.html For example, the 'h' below was typed by my own right-hand index finger. :) Error: Unexpected 'h' when converting from type string to type uint Aliapparently std.conv parse() will say the unexpected input is not the one that caused the error but the character after. in this case "g1" only the 1 was reported.Please file a bug, I'll look into making a fix for it.
Feb 17 2016
On Wed, Feb 17, 2016 at 10:44:40AM -0800, Ali Çehreli via Digitalmars-d-learn wrote:On 02/17/2016 09:09 AM, H. S. Teoh via Digitalmars-d-learn wrote:[...] So where's the bug report?? ;-) T -- "Outlook not so good." That magic 8-ball knows everything! I'll ask about Exchange Server next. -- (Stolen from the net)I shamefully admit that I've discovered this bug months ago and tampered with three error messages on the following page: :D http://ddili.org/ders/d.en/fibers.html For example, the 'h' below was typed by my own right-hand index finger. :) Error: Unexpected 'h' when converting from type string to type uintapparently std.conv parse() will say the unexpected input is not the one that caused the error but the character after. in this case "g1" only the 1 was reported.Please file a bug, I'll look into making a fix for it.
Feb 17 2016
On 02/17/2016 11:08 AM, H. S. Teoh via Digitalmars-d-learn wrote:That's the shame part. :) I was so tired and trying to get things done, I've just changed three characters and moved on. AliFor example, the 'h' below was typed by my own right-hand index finger. :) Error: Unexpected 'h' when converting from type string to type uint[...] So where's the bug report?? ;-)
Feb 17 2016
On Wed, Feb 17, 2016 at 11:16:50AM -0800, Ali Çehreli via Digitalmars-d-learn wrote:On 02/17/2016 11:08 AM, H. S. Teoh via Digitalmars-d-learn wrote:[...] Sigh, nobody got my hint? Oh well, here goes: https://issues.dlang.org/show_bug.cgi?id=15695 And here's the fix: https://github.com/D-Programming-Language/phobos/pull/4008 T -- Fact is stranger than fiction.That's the shame part. :) I was so tired and trying to get things done, I've just changed three characters and moved on.For example, the 'h' below was typed by my own right-hand index finger. :) Error: Unexpected 'h' when converting from type string to type uint[...] So where's the bug report?? ;-)
Feb 17 2016