Yaegi does not properly infer types for generic functions #1610
Open
Description
The following program sample.go
triggers an unexpected result
package main
import "fmt"
var values = []string{
"hello",
"there",
}
func print[T any](v ...[]T) {
fmt.Println(v)
}
func main() {
print(values) // Works with: print[string](values)
}
Expected result
$ go run ./sample.go
// [[hello there]]
Got
$ yaegi ./sample.go
// run: ./sample.go:10:12: undefined type for T
Yaegi Version
Additional Notes
No response
Activity