// expected: has no field or method Bytes // // An interface's method set is written down in the interface itself, so a // name that is not in it is always an error. stage4 skipped interfaces in // reportUndefinedField (a type parameter's methods live in an unresolved // constraint, an interface's do not) and buildIfaceMethodCall emitted the // invoke BEFORE looking the method up and then used "no result type" as its // not-a-method-call signal - which is also how a void method reports itself. // The call therefore evaluated to nil: `len(i.Bytes())` printed 0. // Legacy reports "i.Bytes undefined (type I2 has no field or method Bytes)". package main type I2 interface { Equal(x I2) (ok bool) } type Only struct { b []byte } func (o *Only) Equal(x I2) (ok bool) { return true } func main() { o := Only{b: []byte{1, 2, 3}} var i I2 = &o _ = i.Equal(i) _ = i.Bytes() }