src/internal/types/testdata/fixedbugs/issue78163.go
raw| 1 | // Copyright 2026 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package p |
| 6 | |
| 7 | func _[P any](x P) { |
| 8 | var s []byte |
| 9 | _ = append(s, x /* ERROR "cannot use x (variable of type P constrained by any) as []byte value in argument to append" */ ...) |
| 10 | copy(s, x /* ERROR "invalid copy: argument must be a slice; have x (variable of type P constrained by any)" */) |
| 11 | } |