| ... | @@ -240,19 +240,18 @@ fn testCastConstArrayRefToConstSlice() void { | ... | @@ -240,19 +240,18 @@ fn testCastConstArrayRefToConstSlice() void { |
| 240 | } | 240 | } |
| 241 | | 241 | |
| 242 | test "peer type resolution: error and [N]T" { | 242 | test "peer type resolution: error and [N]T" { |
| 243 | // TODO: implicit error!T to error!U where T can implicitly cast to U | 243 | 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 | } |
| 249 | | 248 | |
| 250 | //fn testPeerErrorAndArray(x: u8) error![]const u8 { | 249 | fn 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 | } |
| 256 | fn testPeerErrorAndArray2(x: u8) anyerror![]const u8 { | 255 | fn testPeerErrorAndArray2(x: u8) anyerror![]const u8 { |
| 257 | return switch (x) { | 256 | return switch (x) { |
| 258 | 0x00 => "OK", | 257 | 0x00 => "OK", |