]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: make error handling more similar
authorRobert Griesemer <gri@golang.org>
Thu, 22 Feb 2024 21:03:52 +0000 (13:03 -0800)
committerGopher Robot <gobot@golang.org>
Fri, 23 Feb 2024 21:21:43 +0000 (21:21 +0000)
commit720306359a5d1d2452b8335a6e7b753751f1d466
treefb573a926a3e6d1cb0024c0478255db929694347
parent727e8d3863f45789e559d4a9d20286026cb5bb07
go/types, types2: make error handling more similar

This change will make error handling between go/types and types2
more similar which will in turn allow more go/types files to be
generated from types2 sources.

Specifically:
- add Checker.newError to create error_ objects
- s/error_.errorf/error_.addf/
- remove error_.String (use error_.msg instead)
- replace Checker.report with error_.report
- make error_.report as similar as currently possible
- adjust dependencies

The new code consistently uses newError/addf/report
to report all errors.

Change-Id: Ibd6fd743a4f7746b4aa6b93fe768814dad9ee9c0
Reviewed-on: https://go-review.googlesource.com/c/go/+/566096
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
21 files changed:
src/cmd/compile/internal/types2/assignments.go
src/cmd/compile/internal/types2/call.go
src/cmd/compile/internal/types2/decl.go
src/cmd/compile/internal/types2/errors.go
src/cmd/compile/internal/types2/errors_test.go
src/cmd/compile/internal/types2/infer.go
src/cmd/compile/internal/types2/initorder.go
src/cmd/compile/internal/types2/labels.go
src/cmd/compile/internal/types2/mono.go
src/cmd/compile/internal/types2/resolver.go
src/cmd/compile/internal/types2/signature.go
src/cmd/compile/internal/types2/stmt.go
src/cmd/compile/internal/types2/struct.go
src/cmd/compile/internal/types2/typeset.go
src/go/types/assignments.go
src/go/types/call.go
src/go/types/errors.go
src/go/types/errors_test.go
src/go/types/generate_test.go
src/go/types/infer.go
src/go/types/stmt.go