D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11052 - allow pathSplitter and to!() template fails
Summary: allow pathSplitter and to!() template fails
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P2 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2013-09-16 07:33 UTC by Andrej Mitrovic
Modified: 2020-03-21 03:56 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 Andrej Mitrovic 2013-09-16 07:33:00 UTC
-----
import std.array;
import std.conv;
import std.path;

void main()
{
    // ng: toImpl template instance failure
    string[] x = to!(string[])(pathSplitter("/foo/bar"));

    // ng: can't convert const(char[])[] => string[]
    string[] y = pathSplitter("/foo/bar").array;

    // ng: toImpl template instance failure
    const(char[])[] z = to!(const(char[])[])(pathSplitter("/foo/bar"));
}
-----

I'm not sure why .array returns const(char[])[] instead of const(char)[][]. Either way, to!() still won't work.
Comment 1 basile-z 2018-08-25 16:05:04 UTC
pull : https://github.com/dlang/phobos/pull/6679
Comment 2 basile-z 2018-08-25 20:48:49 UTC
The second error is already fixed. The first and the last are not bugs but enhancements since `to` is not supposed to convert ranges to array at all.
Comment 3 basile-z 2018-08-25 20:53:27 UTC
`to` was tried as a workaround i think so the problem is gone.