aboutsummaryrefslogtreecommitdiff
path: root/gopls/internal/lsp/analysis/infertypeargs/testdata/src/a/basic.go
diff options
context:
space:
mode:
Diffstat (limited to 'gopls/internal/lsp/analysis/infertypeargs/testdata/src/a/basic.go')
-rw-r--r--gopls/internal/lsp/analysis/infertypeargs/testdata/src/a/basic.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/gopls/internal/lsp/analysis/infertypeargs/testdata/src/a/basic.go b/gopls/internal/lsp/analysis/infertypeargs/testdata/src/a/basic.go
new file mode 100644
index 000000000..1c3d88ba1
--- /dev/null
+++ b/gopls/internal/lsp/analysis/infertypeargs/testdata/src/a/basic.go
@@ -0,0 +1,20 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This file contains tests for the infertyepargs checker.
+
+package a
+
+func f[T any](T) {}
+
+func g[T any]() T { var x T; return x }
+
+func h[P interface{ ~*T }, T any]() {}
+
+func _() {
+ f[string]("hello") // want "unnecessary type arguments"
+ f[int](2) // want "unnecessary type arguments"
+ _ = g[int]()
+ h[*int, int]() // want "unnecessary type arguments"
+}