[Issue 20309] Passing alias this with function returning chain to tempCString hangs up the program
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Dec 8 09:50:30 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20309
berni44 <bugzilla at d-ecke.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bugzilla at d-ecke.de
Component|phobos |dmd
--- Comment #1 from berni44 <bugzilla at d-ecke.de> ---
Reduced example:
```
import std.stdio;
import std.range : chain;
struct Test
{
auto filename() const { return chain("a", "b"); }
alias filename this;
}
void main()
{
auto name = Test();
writeln(name.front);
name.popFront();
writeln(name.front);
}
```
name.front and name.popFront always call filename(), which returns a new range
object... This is IMHO not a phobos bug.
--
More information about the Digitalmars-d-bugs
mailing list