compiler: report correct errors for sink methods
If somebody writes
func (s []int) _() {}
we should report an error. Before this patch we were silently
accepting this code, because we didn't report any errors about the
receiver if the method was a sink.
This patch is unfortunately slightly complex to handle the case of
func (x int) _() {}
which we can only detect after define_global_names.
This fixes blank1.go in the current gc testsuite.
Change-Id: I1b2ef940905d53410ce062a19d7e36e72d392f2d
Reviewed-on: https://go-review.googlesource.com/43456
Reviewed-by: Than McIntosh <thanm@google.com>
4 files changed