blob: b622efdc3587698e8cf4b276da1dea290929ac43 [file] [log] [blame]
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) //@suggestedfix("[[]int]", re"unnecessary type arguments", infer)
_ = app([]int{}, 0)
}
-- @infer/p.go --
@@ -10 +10 @@
- _ = app[[]int]([]int{}, 0) //@suggestedfix("[[]int]", re"unnecessary type arguments", infer)
+ _ = app([]int{}, 0) //@suggestedfix("[[]int]", re"unnecessary type arguments", infer)