This website requires JavaScript.
Explore
Help
Register
Sign In
qbit
/
go
Watch
1
Star
0
Fork
0
You've already forked go
mirror of
https://github.com/golang/go
synced
2024-11-16 19:24:49 -07:00
Code
Releases
Activity
e7100adbca
go
/
test
/
typeparam
/
issue48276a.out
2 lines
4 B
Plaintext
Raw
Normal View
History
Unescape
Escape
go/types, types2: fix implements and identical predicates - Use the correct predicate in Checker.implements: for interfaces we cannot use the API Comparable because it always returns true for all non-type parameter interface types: Comparable simply answers if == and != is permitted, and it's always been permitted for interfaces. Instead we must use Interface.IsComparable which looks at the type set of an interface. - When comparing interfaces for identity, we must also consider the whether the type sets have the comparable bit set. With this change, `any` doesn't implement `comparable` anymore. This only matters for generic functions and types, and the API functions. It does mean that for now (until we allow type-constrained interfaces for general non-constraint use, at some point in the future) a type parameter that needs to be comparable cannot be instantiated with an interface anymore. For #50646. Change-Id: I7e7f711bdcf94461f330c90509211ec0c2cf3633 Reviewed-on: https://go-review.googlesource.com/c/go/+/381254 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
2022-01-26 23:48:44 -07:00
0:0
Copy Permalink