aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/type.go
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2023-04-14 18:18:01 -0400
committerDavid Chase <drchase@google.com>2023-05-10 22:45:24 +0000
commit5deeca38c2506fc7bc0d7c29b05feb961267b8e0 (patch)
tree13ab0929366ac06114543f55b8f6aa997934614a /src/runtime/type.go
parentacba24ff8c66d3c9d70bf0b087ae005c5a408e8d (diff)
downloadgo-5deeca38c2506fc7bc0d7c29b05feb961267b8e0.tar.xz
internal/abi,reflectlite,reflect,runtime: common up chan type
Change-Id: I085b61c544b85d70fabb1c0d9fe91207826dd21a Reviewed-on: https://go-review.googlesource.com/c/go/+/484858 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src/runtime/type.go')
-rw-r--r--src/runtime/type.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/runtime/type.go b/src/runtime/type.go
index bc8ded2821..3e86888ff6 100644
--- a/src/runtime/type.go
+++ b/src/runtime/type.go
@@ -278,11 +278,7 @@ func (mt *maptype) hashMightPanic() bool { // true if hash function might panic
type arraytype = abi.ArrayType
-type chantype struct {
- typ _type
- elem *_type
- dir uintptr
-}
+type chantype = abi.ChanType
type slicetype struct {
typ _type
@@ -506,7 +502,7 @@ func typesEqual(t, v *_type, seen map[_typePair]struct{}) bool {
case kindChan:
ct := (*chantype)(unsafe.Pointer(t))
cv := (*chantype)(unsafe.Pointer(v))
- return ct.dir == cv.dir && typesEqual(ct.elem, cv.elem, seen)
+ return ct.Dir == cv.Dir && typesEqual(toType(ct.Elem), toType(cv.Elem), seen)
case kindFunc:
ft := (*functype)(unsafe.Pointer(t))
fv := (*functype)(unsafe.Pointer(v))