What version of Go are you using (go version)?
$ go version
go version go1.21.3 linux/amd64
Does this issue reproduce with the latest release?
What did you do?
package main
func foo[C ~*T | ~[]T, T any](v C) {} // compiles
func main() {
foo(new(int)) // cannot infer T
foo(make([]int, 3)) // cannot infer T
}
What did you expect to see?
Compiles.
What did you see instead?
Fails to compile.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
What did you do?
What did you expect to see?
Compiles.
What did you see instead?
Fails to compile.