| 1 | export fn invalidArrayElem() u8 { |
| 2 | const array_literal = [1]u8{@as(u8, 256)}; |
| 3 | return array_literal[0]; |
| 4 | } |
| 5 | |
| 6 | export fn invalidTupleElem() u8 { |
| 7 | const tuple_literal = struct { u8 }{@as(u8, 256)}; |
| 8 | return tuple_literal[0]; |
| 9 | } |
| 10 | |
| 11 | export fn invalidStructField() u8 { |
| 12 | const struct_literal = struct { field: u8 }{ .field = @as(u8, 256) }; |
| 13 | return struct_literal.field; |
| 14 | } |
| 15 | |
| 16 | // error |
| 17 | // |
| 18 | // :2:41: error: type 'u8' cannot represent integer value '256' |
| 19 | // :7:49: error: type 'u8' cannot represent integer value '256' |
| 20 | // :12:67: error: type 'u8' cannot represent integer value '256' |