This test verifies the infertypeargs refactoring.
-- go.mod --
module mod.test/infertypeargs
go 1.18
-- p.go --
package infertypeargs
func app[S interface{ ~[]E }, E interface{}](s S, e E) S {
return append(s, e)
}
func _() {
_ = app[[]int]
_ = app[[]int, int]
_ = app[[]int]([]int{}, 0) //@quickfix("[[]int]", re"unnecessary type arguments", infer)
_ = app([]int{}, 0)
}
-- @infer/p.go --
@@ -10 +10 @@
- _ = app[[]int]([]int{}, 0) //@quickfix("[[]int]", re"unnecessary type arguments", infer)
+ _ = app([]int{}, 0) //@quickfix("[[]int]", re"unnecessary type arguments", infer)