[Issue 21905] New: infinite loop when compiling std.algorithm.each on a type with static range primitives

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 7 17:26:26 UTC 2021


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 at puremagic.com
          Reporter: b2.temp at 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.

--


More information about the Digitalmars-d-bugs mailing list