This bug has not yet been (fully) fixed:
------
import std.stdio;
class Wrapper
{
typeof(stdin.byLine()) src;
}
void main()
{
auto x = new Wrapper();
x.src = stdin.byLine();
}
------
Run as 'echo | ./program'. Output:
------
core.exception.InvalidMemoryOperationError@src/core/exception.d(693): Invalid memory operation
------
Comment #7 by ag0aep6g — 2016-03-23T19:23:40Z
(In reply to hsteoh from comment #6)
> This bug has not yet been (fully) fixed:
>
> ------
> import std.stdio;
> class Wrapper
> {
> typeof(stdin.byLine()) src;
> }
> void main()
> {
> auto x = new Wrapper();
> x.src = stdin.byLine();
> }
> ------
>
> Run as 'echo | ./program'. Output:
>
> ------
> core.exception.InvalidMemoryOperationError@src/core/exception.d(693):
> Invalid memory operation
> ------
Works for me. Are you testing with stable?
Comment #8 by hsteoh — 2016-03-23T19:28:59Z
Oh, was this only fixed in stable?
I'm testing with latest git HEAD.
Comment #9 by ag0aep6g — 2016-03-23T20:00:12Z
(In reply to hsteoh from comment #8)
> Oh, was this only fixed in stable?
Yup.
> I'm testing with latest git HEAD.
I'm closing as fixed again, assuming it works for you with stable.
Comment #10 by hsteoh — 2016-03-24T02:33:21Z
Why aren't we fixing this in git HEAD?!
Comment #11 by ag0aep6g — 2016-03-24T05:40:10Z
(In reply to hsteoh from comment #10)
> Why aren't we fixing this in git HEAD?!
It's a regression. Those are fixed against stable, from which point releases are built. As far as I understand, stable is merged back into master from time to time (don't know if there are any rules about it). So the fix should reach master eventually.
Comment #12 by github-bugzilla — 2016-03-24T07:09:54Z