aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/initorder.go
AgeCommit message (Collapse)Author
2021-03-10cmd/compile/internal/types2: better error reporting framework (starting point)Robert Griesemer
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>
2020-12-09[dev.typeparams] cmd/compile/internal/types2: adjust init cycle error ↵Robert Griesemer
message for compiler Enabled some more test/fixedbugs tests. Change-Id: I02102b698eedfbee582b3234850fb01418ebbf7c Reviewed-on: https://go-review.googlesource.com/c/go/+/276453 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com>
2020-10-27[dev.typeparams] cmd/compile/internal/types2: review of initorder.goRobert Griesemer
Difference: errorf now accepts any value that implements the poser interface in place of a position argument. All types2 Objects implement poser. type poser interface { Pos() syntax.Pos } f=initorder.go; diff $f ../../../../go/types/$f 5c5 < package types2 --- > package types 154c154 < check.errorf(obj, "initialization cycle for %s", obj.Name()) --- > check.errorf(obj.Pos(), "initialization cycle for %s", obj.Name()) 157c157 < check.errorf(obj, "\t%s refers to", obj.Name()) // secondary error, \t indented --- > check.errorf(obj.Pos(), "\t%s refers to", obj.Name()) // secondary error, \t indented 161c161 < check.errorf(obj, "\t%s", obj.Name()) --- > check.errorf(obj.Pos(), "\t%s", obj.Name()) Change-Id: Id85074fd15a04bb4ff6e8b68a44be6ac5919c71a Reviewed-on: https://go-review.googlesource.com/c/go/+/265678 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
2020-10-21[dev.typeparams] cmd/compile/internal/importer, types2: initial check-in of ↵Robert Griesemer
types2 and importer This is a copy of the importer and types2 (unreviewed) prototype version excluding the testdata directory containing tests (see below). Each file is marked with the comment // UNREVIEWED on the first line. The plan is to check in this code wholesale (it runs and passes all tests) and then review the code file-by-file via subsequent CLs and remove the "// UNREVIEWED" comments as we review the files. Since most tests are unchanged from the original go/types, the next CL will commit those tests as they don't need to be reviewed again. (Eventually we may want to factor them out and share them from a single place, e.g. the test directory.) The existing file fmtmap_test.go was updated. Change-Id: I9bd0ad1a7e7188b501423483a44d18e623c0fe71 Reviewed-on: https://go-review.googlesource.com/c/go/+/263624 Trust: Robert Griesemer <gri@golang.org> Trust: Keith Randall <khr@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>