digitalmars.D.bugs - [Issue 20258] New: alias this produces an infinite range when used
- d-bugmail puremagic.com (32/32) Oct 01 2019 https://issues.dlang.org/show_bug.cgi?id=20258
https://issues.dlang.org/show_bug.cgi?id=20258 Issue ID: 20258 Summary: alias this produces an infinite range when used with hashmaps Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: major Priority: P1 Component: phobos Assignee: nobody puremagic.com Reporter: andrej.mitrovich gmail.com ----- import std.stdio; struct Set { int[int] set; auto walk () { return this.set.byKey(); } alias walk this; } void main() { Set set; set.set[1] = 10; writefln("Set contents: %s", set.set.byKey()); // ok writefln("Set contents: %s", set); // prints "1" infinitely } ----- Tested with v2.086.1 and v2.088.0 --
Oct 01 2019