Fixes issue 16143
Change-Id: Id9d257aee54d31fbf0d478cb07339729cd9712c0
Reviewed-on: https://go-review.googlesource.com/24325
Reviewed-by: Rob Pike <r@golang.org>
return obj.Name()
}
case *ast.SelectorExpr:
- if sel, ok := info.Selections[fun]; ok {
+ if sel, ok := info.Selections[fun]; ok && sel.Kind() == types.MethodVal {
// method call, e.g. "(*testing.common).Fatal"
meth := sel.Obj()
return fmt.Sprintf("(%s).%s",
var condition bool
var someInt int
+
+// Regression test for Go issue 16143.
+func _() {
+ var x struct{ f func() }
+ x.f()
+}