aboutsummaryrefslogtreecommitdiff
path: root/internal/lsp/analysis/infertypeargs/testdata/src/a/basic.go.golden
blob: 72348ff7750a6b5186ade9f21b0d1cd3290e204f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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("hello") // want "unnecessary type arguments"
	f(2)       // want "unnecessary type arguments"
	_ = g[int]()
	h[*int]() // want "unnecessary type arguments"
}