aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/noder/irgen.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-02-25 14:54:04 -0800
committerRobert Griesemer <gri@golang.org>2021-03-10 00:50:17 +0000
commitacd7cb5887f486558fbcd517ed636a96447d695d (patch)
treebec05bc95acba47b91ddd0f381e328fce9313fd4 /src/cmd/compile/internal/noder/irgen.go
parent142a76530cf610fe02d151727fa0d8038c552127 (diff)
downloadgo-acd7cb5887f486558fbcd517ed636a96447d695d.tar.gz
go-acd7cb5887f486558fbcd517ed636a96447d695d.zip
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>
Diffstat (limited to 'src/cmd/compile/internal/noder/irgen.go')
-rw-r--r--src/cmd/compile/internal/noder/irgen.go8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/cmd/compile/internal/noder/irgen.go b/src/cmd/compile/internal/noder/irgen.go
index 06b234c31d..2de8c3fa60 100644
--- a/src/cmd/compile/internal/noder/irgen.go
+++ b/src/cmd/compile/internal/noder/irgen.go
@@ -41,14 +41,6 @@ func check2(noders []*noder) {
CompilerErrorMessages: true, // use error strings matching existing compiler errors
Error: func(err error) {
terr := err.(types2.Error)
- if len(terr.Msg) > 0 && terr.Msg[0] == '\t' {
- // types2 reports error clarifications via separate
- // error messages which are indented with a tab.
- // Ignore them to satisfy tools and tests that expect
- // only one error in such cases.
- // TODO(gri) Need to adjust error reporting in types2.
- return
- }
base.ErrorfAt(m.makeXPos(terr.Pos), "%s", terr.Msg)
},
Importer: &gcimports{