Skip to content

Commit

Permalink
fix Issue 15963 - Hidden unresolved forward reference issue in std.uni
Browse files Browse the repository at this point in the history
Add explicit return type to two auto functions `Grapheme.opSlice`, then
their calls will have no dependency to return type inference.
  • Loading branch information
9rnsr committed Apr 28, 2016
1 parent fda8267 commit 59b8791
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions std/uni.d
Expand Up @@ -1469,7 +1469,6 @@ private:

static assert(isRandomAccessRange!(SliceOverIndexed!(int[])));

// BUG? forward reference to return type of sliceOverIndexed!Grapheme
SliceOverIndexed!(const(T)) sliceOverIndexed(T)(size_t a, size_t b, const(T)* x)
if (is(Unqual!T == T))
{
Expand Down Expand Up @@ -6660,13 +6659,13 @@ public:
Warning: Invalidates when this Grapheme leaves the scope,
attempts to use it then would lead to memory corruption.
+/
@system auto opSlice(size_t a, size_t b) pure nothrow @nogc
@system SliceOverIndexed!Grapheme opSlice(size_t a, size_t b) pure nothrow @nogc
{
return sliceOverIndexed(a, b, &this);
}

/// ditto
@system auto opSlice() pure nothrow @nogc
@system SliceOverIndexed!Grapheme opSlice() pure nothrow @nogc
{
return sliceOverIndexed(0, length, &this);
}
Expand Down

0 comments on commit 59b8791

Please sign in to comment.