www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21905] New: infinite loop when compiling std.algorithm.each

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

          Issue ID: 21905
           Summary: infinite loop when compiling std.algorithm.each on a
                    type with static range primitives
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

This never ends:

---
struct Conv
{
    static StaticIterable b;
    alias b this;
}

struct StaticIterable
{
    static Conv b; alias b this;
    static void popFront()  {               }
    static bool empty()     { return true;  }
    static int  front()     { return 0;     }
}

void main()
{
    import std.algorithm;
    StaticIterable.each!(a => 0);
} 
---

Possibly rather a problem in phobos.

--
May 07 2021