compiler: finalize methods for type aliases of struct types

Previously we would finalize the methods of the alias type itself, but
since its a type alias we really need to finalize the methods of the
aliased type.

Also, handle method expressions of unnamed struct types.

Test case is

Fixes golang/go#38125

Change-Id: I84c98883ae8641c5fa2b6c5209bf5ef9bb38e57b
Reviewed-by: Than McIntosh <>
Reviewed-by: Cherry Zhang <>
2 files changed