// the Fields to represent the receiver's method set.
if recv := fn.Type().Recv(); recv != nil {
typ := types.ReceiverBaseType(recv.Type)
+ if typ.OrigSym != nil {
+ // For a generic method, we mark the methods on the
+ // base generic type, since those are the methods
+ // that will be stenciled.
+ typ = typ.OrigSym.Def.Type()
+ }
meth := typecheck.Lookdot1(fn, typecheck.Lookup(decl.Name.Value), typ, typ.Methods(), 0)
meth.SetNointerface(true)
}
// of se.Selection, since that will be the type that actually has
// the method.
recv := deref(se.Selection.Type.Recv().Type)
+ if len(recv.RParams()) == 0 {
+ // The embedded type that actually has the method is not
+ // actually generic, so no need to build a closure.
+ return x
+ }
baseType := recv.OrigSym.Def.Type()
var gf *ir.Name
for _, m := range baseType.Methods().Slice() {
baseSym := typ.OrigSym
baseType := baseSym.Def.(*ir.Name).Type()
for j, _ := range typ.Methods().Slice() {
+ if baseType.Methods().Slice()[j].Nointerface() {
+ typ.Methods().Slice()[j].SetNointerface(true)
+ }
baseNname := baseType.Methods().Slice()[j].Nname.(*ir.Name)
// Eagerly generate the instantiations and dictionaries that implement these methods.
// We don't use the instantiations here, just generate them (and any
"typeparam/nested.go", // -G=3 doesn't support function-local types with generics
- "typeparam/mdempsky/4.go", // -G=3 can't export functions with labeled breaks in loops
- "typeparam/mdempsky/15.go", // ICE in (*irgen).buildClosure
+ "typeparam/mdempsky/4.go", // -G=3 can't export functions with labeled breaks in loops
)
var unifiedFailures = setOf(