]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: typeparams.IndexExpr must not be an ast.Expr
authorRob Findley <rfindley@google.com>
Sat, 6 Jan 2024 00:19:14 +0000 (19:19 -0500)
committerGopher Robot <gobot@golang.org>
Mon, 22 Jan 2024 16:17:05 +0000 (16:17 +0000)
commit8435659a43e46d4088cd5dcd09ee9fb87a5a0ae6
treecac9021bc54eea54a06e72f0b4e95fd0216d43fb
parentd3f713bbd11ce9da507b21968179012b62d1a52c
go/types, types2: typeparams.IndexExpr must not be an ast.Expr

The typeparams.IndexExpr wrapper type was added as a compatibility layer
to make the go/types code symmetric with types2. However, this type
incidentally implemented the ast.Expr interface, leading to the
accidental misuse that led to golang/go#63933.

Fix this minimally for now, though leave a TODO that this old
compatibility shim really needs to be eliminated.

Also fix a case in types2 where operand.expr was set to a typed nil.

Fixes golang/go#63933

Change-Id: I180d411e52f795a8322ecce6ed8649e88af1c63b
Reviewed-on: https://go-review.googlesource.com/c/go/+/554395
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/compile/internal/types2/call.go
src/go/internal/typeparams/typeparams.go
src/go/types/call.go
src/go/types/index.go