aboutsummaryrefslogtreecommitdiff
path: root/src/go/types/issues_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/go/types/issues_test.go')
-rw-r--r--src/go/types/issues_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/go/types/issues_test.go b/src/go/types/issues_test.go
index 4a559cbab3..282939d641 100644
--- a/src/go/types/issues_test.go
+++ b/src/go/types/issues_test.go
@@ -974,3 +974,20 @@ func f[I *T, T any]() {
t.Fatalf("types of v and T are not pointer-identical: %p != %p", v.Type().(*TypeParam), T)
}
}
+
+func TestIssue64759(t *testing.T) {
+ const src = `
+//go:build go1.18
+package p
+
+func f[S ~[]E, E any](S) {}
+
+func _() {
+ f([]string{})
+}
+`
+ // Per the go:build directive, the source must typecheck
+ // even though the (module) Go version is set to go1.17.
+ conf := Config{GoVersion: "go1.17"}
+ mustTypecheck(src, &conf, nil)
+}