// expected: a fixed extent is not text // // A fixed extent is not a slice, so it cannot be converted to text. go/types // rejects both directions (`string([8]byte)`, `[]byte([8]byte)`) and legacy // reports "cannot convert ... to type string"; stage4 lowered it as a bitcast // from `[8 x i8]` to the slice header, which clang refuses: // // error: invalid cast opcode for cast from '[8 x i8]' to '{ ptr, i64, i64 }' // // The conversion that exists is `string(buf[:])` - the array becomes a slice // view first, and then text. `internal/xcoff` is where the rejected shape was // reached. package main type hdr struct { Name [8]byte } func main() { var h hdr h.Name[0] = 'a' println(string(h.Name)) }