var dictAssign *ir.AssignStmt
if outer != nil {
dictVar = ir.NewNameAt(pos, typecheck.LookupNum(typecheck.LocalDictName, g.dnum))
+ dictVar.SetSym(outer.Sym().Pkg.Lookup(dictVar.Sym().Name))
g.dnum++
dictVar.Class = ir.PAUTO
typed(types.Types[types.TUINTPTR], dictVar)
var rcvrAssign ir.Node
if rcvrValue != nil {
rcvrVar = ir.NewNameAt(pos, typecheck.LookupNum(".rcvr", g.dnum))
+ if outer != nil {
+ rcvrVar.SetSym(outer.Sym().Pkg.Lookup(rcvrVar.Sym().Name))
+ }
g.dnum++
typed(rcvrValue.Type(), rcvrVar)
rcvrAssign = ir.NewAssignStmt(pos, rcvrVar, rcvrValue)
for i := 0; i < typ.NumParams(); i++ {
t := typ.Params().Field(i).Type
arg := ir.NewNameAt(pos, typecheck.LookupNum("a", i))
+ if outer != nil {
+ arg.SetSym(outer.Sym().Pkg.Lookup(arg.Sym().Name))
+ }
arg.Class = ir.PPARAM
typed(t, arg)
arg.Curfn = fn
for i := 0; i < typ.NumResults(); i++ {
t := typ.Results().Field(i).Type
result := ir.NewNameAt(pos, typecheck.LookupNum("r", i)) // TODO: names not needed?
+ if outer != nil {
+ result.SetSym(outer.Sym().Pkg.Lookup(result.Sym().Name))
+ }
result.Class = ir.PPARAMOUT
typed(t, result)
result.Curfn = fn
--- /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
+
+func Compare[T int | uint](a, b T) int {
+ return 0
+}
+
+type Slice[T int | uint] struct{}
+
+func (l Slice[T]) Comparator() func(v1, v2 T) int {
+ return Compare[T]
+}
--- /dev/null
+// compiledir -G=3
+
+// 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