Hi,
I'm reading the new typechecker source code of go compiler(under directory cmd/compile/internal/types2), during the initialization process, universe.go registers an implicit interface "comparable" inside function
defPredeclaredComparable, I know it's supposed to be used for
type comparison but failed to find where and how this interface and related method "==" is used.
In
predicates.go there's a function 'Comparable" to check whether a type is comparable or not, but seems there's nothing to do with the interface.
And I don't understand the lookup logic for method "==" in
type.go neither, how could an Interface type have method named "=="?
I searched a lot from the code base but failed to find the answer, could anybody kindly give me some clue?
Thanks a lot :-)