https://issues.dlang.org/show_bug.cgi?id=12662

          Issue ID: 12662
           Summary: std.range.retro is not @nogc
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nob...@puremagic.com
          Reporter: bearophile_h...@eml.cc

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'

--

Reply via email to