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