compiler: compare parse methods when indexing interface types for export

This change fixes a bug in which two interface types were being
incorrectly commoned (considered identical) in the initial stages of
writing out types to export data. The indexer does a walk to collect
candidates for export, inserting types into a table to eliminate
duplicates; as part of this process a local interface type T1 was
being commoned with a different interface type T2. This caused a cycle
in the exported type graph due to the way embedded interfaces are
handled.

The fix was to add a new flag to the Type::is_identical utility
routine to request that interface type comparison be done by examining
the original parse methods, as opposed to the expanded method set,
then use the new flag when creating the hash map for the exporter.

Fixes golang/go#30659.

Change-Id: I32efbbee0e66f5d8cdc1cf711011de2c3cd829cf
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/166638
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 files changed