)
type ident struct {
- pkg string
+ pkg *types2.Package
name string
}
t := types2.NewTypeParam(tn, nil)
// To handle recursive references to the typeparam within its
// bound, save the partial type in tparamIndex before reading the bounds.
- id := ident{r.currPkg.Name(), name}
+ id := ident{r.currPkg, name}
r.p.tparamIndex[id] = t
var implicit bool
errorf("unexpected type param type")
}
pkg, name := r.qualifiedIdent()
- id := ident{pkg.Name(), name}
+ id := ident{pkg, name}
if t, ok := r.p.tparamIndex[id]; ok {
// We're already in the process of importing this typeparam.
return t
)
type ident struct {
- pkg string
+ pkg *types.Package
name string
}
t := types.NewTypeParam(tn, nil)
// To handle recursive references to the typeparam within its
// bound, save the partial type in tparamIndex before reading the bounds.
- id := ident{r.currPkg.Name(), name}
+ id := ident{r.currPkg, name}
r.p.tparamIndex[id] = t
var implicit bool
errorf("unexpected type param type")
}
pkg, name := r.qualifiedIdent()
- id := ident{pkg.Name(), name}
+ id := ident{pkg, name}
if t, ok := r.p.tparamIndex[id]; ok {
// We're already in the process of importing this typeparam.
return t
--- /dev/null
+// Copyright 2022 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.
+
+package a
+
+type T[K any] struct {
+}
--- /dev/null
+// Copyright 2022 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.
+
+package a
+
+import (
+ "./a"
+)
+
+type T[K any] struct {
+ t a.T[K]
+}
--- /dev/null
+// Copyright 2022 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.
+
+package p
+
+import (
+ a "./aa"
+)
+
+var Foo a.T[int]
--- /dev/null
+// compiledir -s
+
+// Copyright 2022 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.
+
+package ignored