// Pushing an untyped nil as the element of a slice of slices. The element // conversion nil -> []T is a zero value of an AGGREGATE type, and the IR for it // was spelled `null` (the pointer zero) instead of `zeroinitializer`, which // clang rejects: "null must be a pointer type". Seen in text/tabwriter // (`b.lines = push(b.lines, nil)`). package main type cell struct { b []byte } func main() { // Termination: a batch program must still be stoppable, so the entry // handles the channel the runtime closes on SIGINT/SIGTERM. select { case <-shutdown: return default: } lines := [][]cell{:1} lines = lines[:0] lines = push(lines, nil) if len(lines) != 1 { panic("expected one line") } if len(lines[0]) != 0 { panic("expected an empty line") } lines[0] = push(lines[0], cell{b: []byte("x")}) if len(lines[0]) != 1 { panic("expected one cell") } }