]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: better error messages for channel sends and receives
authorRobert Griesemer <gri@golang.org>
Thu, 6 Feb 2025 21:51:51 +0000 (13:51 -0800)
committerGopher Robot <gobot@golang.org>
Sat, 8 Feb 2025 04:40:05 +0000 (20:40 -0800)
commita4fcfaa1676f40a1dc5879cdabe98471c6054daf
tree177ec7526640508960f66f523debc738b9d593c2
parentff627d28dbc5fc3ef156c36f74b5dd026b41d21b
go/types, types2: better error messages for channel sends and receives

Use the same code pattern for sends and receives and factor it out
into a new helper method Checker.chanElem.

Provide the exact error cause rather than simply referring to the
core type.

For #70128.

Change-Id: I4a0b597a487b78c057eebe06c4ac28f9bf1f7719
Reviewed-on: https://go-review.googlesource.com/c/go/+/647455
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/compile/internal/types2/expr.go
src/cmd/compile/internal/types2/stmt.go
src/go/types/expr.go
src/go/types/stmt.go
src/internal/types/testdata/fixedbugs/issue43671.go
src/internal/types/testdata/fixedbugs/issue47115.go