compiler: avoid crash on real declaration of type with existing method
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 <4b2922593166fc595a9b1a408f34f5d3817fe9d2@google.com>
Reviewed-by: Cherry Zhang <d62e63aa42ce272d7b6a5055d97e942b33a34679@google.com>

golang/gofrontend,golang/gofrontend,golang/gofrontend,golang/gofrontend