]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/types2: better error reporting framework (starting point)
authorRobert Griesemer <gri@golang.org>
Thu, 25 Feb 2021 22:54:04 +0000 (14:54 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 10 Mar 2021 00:50:17 +0000 (00:50 +0000)
commitacd7cb5887f486558fbcd517ed636a96447d695d
treebec05bc95acba47b91ddd0f381e328fce9313fd4
parent142a76530cf610fe02d151727fa0d8038c552127
cmd/compile/internal/types2: better error reporting framework (starting point)

Until now, errors which came with additional details (e.g., a declaration
cycle error followed by the list of objects involved in the cycle, one per
line) were reported as an ordinary error followed by "secondary" errors,
with the secondary errors marked as such by having a tab-indented error
message.

This approach often required clients to filter these secondary errors
(as they are not new errors, they are just clarifying a previously
reported error).

This CL introduces a new internal error_ type which permits accumulating
various error information that may then be reported as a single error.

Change-Id: I25b2f094facd37e12737e517f7ef8853d465ff77
Reviewed-on: https://go-review.googlesource.com/c/go/+/296689
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/noder/irgen.go
src/cmd/compile/internal/types2/check_test.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/initorder.go
src/cmd/compile/internal/types2/labels.go
src/cmd/compile/internal/types2/resolver.go
src/cmd/compile/internal/types2/stmt.go
src/cmd/compile/internal/types2/typexpr.go