compiler: avoid crash on real declaration of type with existing method

This avoids a compiler crash on invalid code.

Fixes https://gcc.gnu.org/PR90272

Change-Id: I6625b868e448d59ca814056fe9159040c7095e04
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/174377
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
1 file changed