20030, "benharsh", "channel.read(type T) not throwing EOF", "2022-06-17T00:07:53Z"
Summary of Problem
Currently channel.read(type T) : T
does not throw an EOF error. I believe this is an oversight due to the method's currently trivial implementation where we simply invoke channel.read(val)
and ignore the returned result. While there is ongoing discussion about the design of channel.read
in general, I see no reason that this method in particular should not throw an EOF error at this time.
Steps to Reproduce
Source Code:
use IO;
var f = openmem();
var r = f.reader();
var x = r.read(int);
writeln(x);
This program prints "0".