[Issue 22599] New: Infinite loop using join with alias this
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Dec 14 17:43:07 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22599
Issue ID: 22599
Summary: Infinite loop using join with alias this
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: yazan.dabain at gmail.com
Running the code below results in an infinite loop.
Removing alias this, the map call or using ascii makes the code run as
expected.
```
import std.algorithm: map;
import std.array: join;
struct T
{
string a;
alias a this;
}
void main()
{
auto t = [ T("أ") ]; // has to contain non-ascii unicode (this is the
arabic letter أ)
auto s = t.map!(same => same).join();
}
```
--
More information about the Digitalmars-d-bugs
mailing list