diff options
author | Matthew Dempsky <mdempsky@google.com> | 2021-07-28 12:59:14 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2021-07-28 21:41:07 +0000 |
commit | adedf54288e826bd93ccf22ad104f768d42289d4 (patch) | |
tree | 2fe786ecc9202827525f52896b45ce1e43bbf671 /test/inline.go | |
parent | 53557530093938e19c21f6b02a482939ac6e634b (diff) | |
download | go-adedf54288e826bd93ccf22ad104f768d42289d4.tar.gz go-adedf54288e826bd93ccf22ad104f768d42289d4.zip |
[dev.typeparams] test: rename blank functions
This CL renames blank functions in the test/ directory so that they
don't rely on the compiler doing anything more than typechecking them.
In particular, I ran this search to find files that used blank
functions and methods:
$ git grep -l '^func.*\b_(' | xargs grep -n '^' | grep '\.go:1:' | grep -v '// errorcheck$'
I then skipped updating a few files:
* blank.go
* fixedbugs/issue11699.go
* fixedbugs/issue29870.go
These tests specifically check that blank functions/methods work.
* interface/fail.go
Not sure the motivation for the blank method here, but it's empty
anyway.
* typeparam/tparam1.go
Type-checking test, but uses "-G" (to use types2 instead of typecheck).
Updates #47446.
Change-Id: I9ec1714f499808768bd0dcd7ae6016fb2b078e5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/338094
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'test/inline.go')
-rw-r--r-- | test/inline.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/inline.go b/test/inline.go index 2cda07b2da..a73c0ba7b1 100644 --- a/test/inline.go +++ b/test/inline.go @@ -49,7 +49,7 @@ func j(x int) int { // ERROR "can inline j" } } -func _() int { // ERROR "can inline _" +func f2() int { // ERROR "can inline f2" tmp1 := h tmp2 := tmp1 return tmp2(0) // ERROR "inlining call to h" @@ -167,7 +167,7 @@ func (T) meth(int, int) {} // ERROR "can inline T.meth" func k() (T, int, int) { return T{}, 0, 0 } // ERROR "can inline k" -func _() { // ERROR "can inline _" +func f3() { // ERROR "can inline f3" T.meth(k()) // ERROR "inlining call to k" "inlining call to T.meth" // ERRORAUTO "inlining call to T.meth" } |