authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-12 19:45:33-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-12 19:45:33-05:00
loge54c49be9b4b1a97805a3ffaab3f21bac48b8851
treea84797a9ccbc4bf9d6afa55a067eebe053a88103
parent1e4bae669233042e60a9201158ac239a64fb4c66
signaturelock-open Commit is signed but in an unrecognized format.

uncomment a now-passing behavior test


1 files changed, 8 insertions(+), 9 deletions(-)

test/stage1/behavior/cast.zig+8-9
...@@ -240,19 +240,18 @@ fn testCastConstArrayRefToConstSlice() void {...@@ -240,19 +240,18 @@ fn testCastConstArrayRefToConstSlice() void {
240}240}
241241
242test "peer type resolution: error and [N]T" {242test "peer type resolution: error and [N]T" {
243 // TODO: implicit error!T to error!U where T can implicitly cast to U243 expect(mem.eql(u8, try testPeerErrorAndArray(0), "OK"));
244 //expect(mem.eql(u8, try testPeerErrorAndArray(0), "OK"));244 comptime expect(mem.eql(u8, try testPeerErrorAndArray(0), "OK"));
245 //comptime expect(mem.eql(u8, try testPeerErrorAndArray(0), "OK"));
246 expect(mem.eql(u8, try testPeerErrorAndArray2(1), "OKK"));245 expect(mem.eql(u8, try testPeerErrorAndArray2(1), "OKK"));
247 comptime expect(mem.eql(u8, try testPeerErrorAndArray2(1), "OKK"));246 comptime expect(mem.eql(u8, try testPeerErrorAndArray2(1), "OKK"));
248}247}
249248
250//fn testPeerErrorAndArray(x: u8) error![]const u8 {249fn testPeerErrorAndArray(x: u8) anyerror![]const u8 {
251// return switch (x) {250 return switch (x) {
252// 0x00 => "OK",251 0x00 => "OK",
253// else => error.BadValue,252 else => error.BadValue,
254// };253 };
255//}254}
256fn testPeerErrorAndArray2(x: u8) anyerror![]const u8 {255fn testPeerErrorAndArray2(x: u8) anyerror![]const u8 {
257 return switch (x) {256 return switch (x) {
258 0x00 => "OK",257 0x00 => "OK",