Per the spec, "the type sets of all non-interface terms must be
pairwise disjoint (the pairwise intersection of the type sets must
be empty)" in a union.
For the overlap test, the existing implementation casually mixed
syntactic union terms (which may have interface type) with type set
terms (which are normalized/expanded and must not have interface
type). As a consequence, in some cases the overlap test failed.
This change skips terms with interface types in the overlap test.
For this cherry-pick, also rename the files ending in issue51607.go
to issue51607.go2 because the 1.18 branch requires tests containing
generic features to end in .go2.
Trust: Robert Griesemer <firstname.lastname@example.org>
Run-TryBot: Robert Griesemer <email@example.com>
TryBot-Result: Gopher Robot <firstname.lastname@example.org>
Reviewed-by: Ian Lance Taylor <email@example.com>
Reviewed-by: Robert Findley <firstname.lastname@example.org>