Bug 9605 – std.conv.parse!(string, string) fails

Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-27T03:52:47Z
Last change time
2024-12-01T16:16:39Z
Assigned to
No Owner
Creator
monarchdodra
Moved to GitHub: phobos#9599 →

Comments

Comment #0 by monarchdodra — 2013-02-27T03:52:47Z
Basically, std.conv.parse!(string, string) expects the string to be in the form of an array of chars: //---- import std.conv; void main() { string s1 = `[['h', 'e', 'l', 'l', 'o'], ['w', 'o', 'r', 'l', 'd']]`; string s2 = `["hello", "world"]`; string s3 = `['h', 'e', 'l', 'l', 'o']`; string s4 = `"hello"`; auto ss1 = parse!(string[])(s1); auto ss2 = parse!(string[])(s2); auto ss3 = parse!(string )(s3); auto ss4 = parse!(string )(s4); //Can't parse string: "[" is missing return; } //---- The irony though is that if you place the string inside an array (s1 and s2), then conv will actually support both forms of parse.
Comment #1 by andrej.mitrovich — 2014-04-24T18:43:53Z
Hmm.. Can this be fixed without breaking code?
Comment #2 by bugzilla — 2021-02-07T11:15:13Z
(In reply to Andrej Mitrovic from comment #1) > Hmm.. Can this be fixed without breaking code? All bug fixes break codes that rely on that bug...
Comment #3 by robert.schadek — 2024-12-01T16:16:39Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9599 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB