aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/errorcalls_test.go
AgeCommit message (Collapse)Author
2021-06-23[dev.typeparams] cmd/compile/internal/syntax: go/ast-style walk APIMatthew Dempsky
This CL adds go/ast's Visitor, Walk, and Inspect functions to package syntax. Having functions with the same API and semantics as their go/ast counterparts reduces the mental load of context switching between go/ast and syntax. It also renames the existing Walk function into Crawl, and marks it as a deprecated wrapper around Inspect. (I named it "Crawl" because it's less functional than "Walk"... get it??) There aren't that many callers to Crawl, so we can probably remove it in the future. But it doesn't seem pressing, and I'm more concerned about the risk of forgetting to invert a bool condition somewhere. Change-Id: Ib2fb275873a1d1a730249c9cb584864cb6ec370e Reviewed-on: https://go-review.googlesource.com/c/go/+/330429 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Trust: Matthew Dempsky <mdempsky@google.com> Trust: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
2021-03-13cmd/compile/internal/types2: simplify error reporting API (cleanup)Robert Griesemer
- Remove specialized errorf functions for invalid AST/argument/operation. Instead use prefix constants with the error message. - Replace several calls to Checker.errorf with calls to Checker.error if there are no arguments to format. - Replace a handful of %s format verbs with %v to satisfy vet check. - Add a basic test that checks that we're not using Checker.errorf when we should be using Checker.error. Change-Id: I7bc7c14f3cf774689ec8cd5782ea31b6e30dbcd6 Reviewed-on: https://go-review.googlesource.com/c/go/+/300995 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>