aboutsummaryrefslogtreecommitdiff
path: root/std/io.zig
diff options
context:
space:
mode:
authortgschultz <tgschultz@gmail.com>2018-11-30 14:31:08 -0600
committertgschultz <tgschultz@gmail.com>2018-11-30 14:50:17 -0600
commit5936bdf8a4163d0c75444e5c8554316de63e3864 (patch)
treecf955950658ae425666560bc8e563989cb22b2c4 /std/io.zig
parentb6489ff90afffcf0c69490efcb5941f3bb42fc3c (diff)
downloadzig-5936bdf8a4163d0c75444e5c8554316de63e3864.tar.gz
zig-5936bdf8a4163d0c75444e5c8554316de63e3864.zip
Fixed readBits to cast errors to the correct errorset. See #1810 for why this wasn't caught earlier.
Diffstat (limited to 'std/io.zig')
-rw-r--r--std/io.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/std/io.zig b/std/io.zig
index 499422fdcc..5f710a5033 100644
--- a/std/io.zig
+++ b/std/io.zig
@@ -526,7 +526,9 @@ pub fn BitInStream(endian: builtin.Endian, comptime Error: type) type {
if (err == error.EndOfStream) {
return @intCast(U, out_buffer);
}
- return err;
+ //@BUG: See #1810. Not sure if the bug is that I have to do this for some
+ // streams, or that I don't for streams with emtpy errorsets.
+ return @errSetCast(Error, err);
};
switch (endian) {