compiler: always sort interface parse methods
The exporter relies on sorting interface parse methods. It would sort
them as it encountered interface types. However, when an interface
type is an element of a struct or array type, the exporter might
encounter that interface type before sorting the parse methods. If it
then encountered an identical interface type again, it could get
confused about whether the two types are identical or not.
Fix the problem by always sorting the parse methods in the
finalize_methods pass.
Also firm up the export type sorting to make sure we never have this
kind of confusion again. Doing this revealed that we need to be more
careful about sorting in order to handle aliases correctly.
Also fix the interface type hash computation to use the right hash
value when looking at parse methods rather than all methods.
The test case for this is https://go.dev/cl/405759.
Fixes golang/go#52841
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/405556