This website requires JavaScript.
Explore
Help
Sign in
languages
/
go
Watch
1
Star
0
Fork
You've already forked go
0
mirror of
https://github.com/golang/go
synced
2024-11-02 09:03:03 +00:00
Code
Issues
Projects
Releases
Packages
Wiki
Activity
258fc75505
go
/
test
/
typeparam
/
issue48276a.out
2 lines
4 B
Text
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-27 06:48:44 +00:00
0:0
Reference in a new issue
Copy permalink