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

fix Issue 11691 - can't join pathSplitter with pathSeparator #1749

Merged
merged 2 commits into from
Dec 5, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions std/path.d
Original file line number Diff line number Diff line change
Expand Up @@ -1544,9 +1544,9 @@ auto pathSplitter(C)(const(C)[] path) @safe pure nothrow
static struct PathSplitter
{
@safe pure nothrow:
@property empty() const { return _empty; }
@property bool empty() const { return _empty; }

@property front() const
@property const(C)[] front() const
{
assert (!empty, "PathSplitter: called front() on empty range");
return _front;
Expand Down Expand Up @@ -1577,7 +1577,7 @@ auto pathSplitter(C)(const(C)[] path) @safe pure nothrow
}
}

@property back() const
@property const(C)[] back() const
{
assert (!empty, "PathSplitter: called back() on empty range");
return _back;
Expand Down Expand Up @@ -1730,6 +1730,10 @@ unittest
{
assert (equal(pathSplitter("/foo/bar".dup), ["/", "foo", "bar"]));
});

// Bugzilla 11691
// front should return a mutable array of const elements
static assert(is(typeof(pathSplitter!char(null).front) == const(char)[]));
}


Expand Down