aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2022-12-01 09:39:45 -0800
committerRobert Griesemer <gri@google.com>2022-12-01 19:48:07 +0000
commit8fd2875c3e9455df722dd3c930332591eebbb3c2 (patch)
treeeb7025c1a23cb59144d7d696b24d15db512857be /src/runtime
parentaf1a5d92871129e5fff093bcb3518b1ebfc86976 (diff)
downloadgo-8fd2875c3e9455df722dd3c930332591eebbb3c2.tar.xz
go/types, types2: make the new comparable semantics the default
Ordinary interface types now satisfy comparable constraints. This is a fully backward-compatible change: it simply permits additional code to be valid that wasn't valid before. This change makes the new comparable semantics the default behavior, depending on the Go -lang version. It also renames the flag types2.Config.AltComparableSemantics to types2.Config.OldComparableSemantics and inverts its meaning (or types.Config.oldComparableSemantics respectively). Add new predicate Satisfies (matching the predicate Implements but for constraint satisfaction), per the proposal description. Adjust some existing tests by setting -oldComparableSemantics and add some new tests that verify version-dependent behavior. The compiler flag -oldcomparable may be used to temporarily switch back to the Go 1.18/1.19 behavior should this change cause problems, or to identify that a problem is unrelated to this change. The flag will be removed for Go 1.21. For #52509. For #56548. For #57011. Change-Id: I8b3b3d9d492fc24b0693567055f0053ccb5aeb42 Reviewed-on: https://go-review.googlesource.com/c/go/+/454575 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/runtime')
0 files changed, 0 insertions, 0 deletions