Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std.conv.parse!(string, string) fails #9599

Open
dlangBugzillaToGithub opened this issue Feb 27, 2013 · 2 comments
Open

std.conv.parse!(string, string) fails #9599

dlangBugzillaToGithub opened this issue Feb 27, 2013 · 2 comments

Comments

@dlangBugzillaToGithub
Copy link

monarchdodra reported this on 2013-02-27T03:52:47Z

Transfered from https://issues.dlang.org/show_bug.cgi?id=9605

CC List

Description

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.
@dlangBugzillaToGithub
Copy link
Author

andrej.mitrovich (@AndrejMitrovic) commented on 2014-04-24T18:43:53Z

Hmm.. Can this be fixed without breaking code?

@dlangBugzillaToGithub
Copy link
Author

bugzilla (@WalterBright) commented on 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...

@LightBender LightBender removed the P3 label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants