Bug 12662 – std.range.retro is not @nogc

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2014-04-27T11:01:00Z
Last change time
2014-09-18T16:03:27Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2014-04-27T11:01:20Z
void main() @nogc { import std.range: retro; int[] data; foreach_reverse (x; data) {} // OK foreach (x; data.retro) {} // Error } DMD 2.066alpha gives: test.d(5,5): Error: @nogc function 'D main' cannot call non-@nogc function 'std.range.retro!(int[]).retro.Result!().Result.front'
Comment #1 by hsteoh — 2014-09-18T14:51:45Z
Works on git HEAD now. Submitted a unittest to prevent regression in the future: https://github.com/D-Programming-Language/phobos/pull/2529
Comment #2 by github-bugzilla — 2014-09-18T16:03:27Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/99d728a3eb28b6ae3f764c1db972e84edf726232 Add @nogc unittest for std.range.retro. To prevent regression of issue 12662. https://github.com/D-Programming-Language/phobos/commit/8b6df553e80fc1eaf5656a743697c24ac5cf06a7 Merge pull request #2529 from quickfur/issue12662 Add @nogc unittest for std.range.retro.