Skip to content

Commit 8986f14

Browse files
authored
Merge pull request #5042 from DmitryOlshansky/fix-issue-17066
Fix issue 17066
2 parents e3df7f2 + 4d19d0a commit 8986f14

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

std/algorithm/iteration.d

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,6 +2387,11 @@ if (isInputRange!RoR && isInputRange!(ElementType!RoR))
23872387
else
23882388
_current = _items.front;
23892389
};
2390+
this(RoR items, ElementType!RoR current)
2391+
{
2392+
_items = items;
2393+
_current = current;
2394+
}
23902395
public:
23912396
this(RoR r)
23922397
{
@@ -2441,10 +2446,7 @@ if (isInputRange!RoR && isInputRange!(ElementType!RoR))
24412446
{
24422447
@property auto save()
24432448
{
2444-
Result copy = this;
2445-
copy._items = _items.save;
2446-
copy._current = _current.save;
2447-
return copy;
2449+
return Result(_items.save, _current.save);
24482450
}
24492451
}
24502452
}

std/regex/internal/tests3.d

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,3 +303,19 @@ unittest
303303
assert("abc".matchFirst(r));
304304
assertThrown(regex("(?#..."));
305305
}
306+
307+
// bugzilla 17066
308+
unittest
309+
{
310+
string message = "fix issue 16319 and fix std.traits.isInnerClass";
311+
static auto matchToRefs(M)(M m)
312+
{
313+
// ctRegex throws a weird error in unittest compilation
314+
enum splitRE = regex(`[^\d]+`);
315+
return m.captures[5].splitter(splitRE);
316+
}
317+
318+
enum issueRE = ctRegex!(`((close|fix|address)e?(s|d)? )` ~
319+
`?(ticket|bug|tracker item|issue)s?:? *([\d ,\+&#and]+)`, "i");
320+
message.matchAll(issueRE).map!matchToRefs.joiner.array;
321+
}

0 commit comments

Comments
 (0)