]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix recursive generic interface instantiation
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Wed, 31 Jan 2024 07:47:40 +0000 (14:47 +0700)
committerGopher Robot <gobot@golang.org>
Tue, 16 Jul 2024 16:43:30 +0000 (16:43 +0000)
commit8b48290895d362417124bcc18f0e6b6476ddc99e
tree0d87fb70b188b5727949b388aea173ccfe66281f
parent959b3fd4265d7e4efb18af454cd18799ed70b8fe
cmd/compile: fix recursive generic interface instantiation

When shapifying recursive instantiated types, the compiler ends up
leaving the type as-is if it already has been a shape type. However, if
both of type arguments are interfaces, and one of them is a recursive
one, it ends up being shaped as-is, while the other is shaped to its
underlying, causing mismatch in function signature.

Fixing this by shapifying an interface type as-is, if it is fully
instantiated and already been a shape type.

Fixes #65362
Fixes #66663

Change-Id: I839d266e0443b41238b1b7362aca09adc0177362
Reviewed-on: https://go-review.googlesource.com/c/go/+/559656
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/noder/reader.go
test/fixedbugs/issue65362.go [new file with mode: 0644]
test/fixedbugs/issue66663.go [new file with mode: 0644]