Skip to content

Commit

Permalink
fix Issue 11691 - can't join pathSplitter with pathSeparator
Browse files Browse the repository at this point in the history
- The inferred return type of front had an additional
  layer of const because it's a const method.
  • Loading branch information
MartinNowak committed Dec 5, 2013
1 parent a30171a commit c125143
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 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 @@ -1732,7 +1732,8 @@ unittest
});

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


Expand Down

0 comments on commit c125143

Please sign in to comment.