aboutsummaryrefslogtreecommitdiff
path: root/test/typeparam/dictionaryCapture-noinline.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-07-28 13:39:30 -0700
committerMatthew Dempsky <mdempsky@google.com>2021-07-28 21:40:40 +0000
commit53557530093938e19c21f6b02a482939ac6e634b (patch)
tree18d51aa04629aaad621399e997306118b36a5952 /test/typeparam/dictionaryCapture-noinline.go
parent473e493d18c277d69e40a4930af045d474ff2be4 (diff)
downloadgo-53557530093938e19c21f6b02a482939ac6e634b.tar.gz
go-53557530093938e19c21f6b02a482939ac6e634b.zip
[dev.typeparams] test/typeparam: gofmt -w
We don't usually reformat the test directory, but all of the files in test/typeparam are syntactically valid. I suspect the misformattings here are because developers aren't re-installing gofmt with -tags=typeparams, not intentionally exercising non-standard formatting. Change-Id: I3767d480434c19225568f3c7d656dc8589197183 Reviewed-on: https://go-review.googlesource.com/c/go/+/338093 Trust: Matthew Dempsky <mdempsky@google.com> Trust: Robert Griesemer <gri@golang.org> 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/typeparam/dictionaryCapture-noinline.go')
-rw-r--r--test/typeparam/dictionaryCapture-noinline.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/typeparam/dictionaryCapture-noinline.go b/test/typeparam/dictionaryCapture-noinline.go
index 4b46d5f57f..ad5bfa008e 100644
--- a/test/typeparam/dictionaryCapture-noinline.go
+++ b/test/typeparam/dictionaryCapture-noinline.go
@@ -44,7 +44,7 @@ func is7(x int) {
}
func is77(x, y int) {
if x != 7 || y != 7 {
- println(x,y)
+ println(x, y)
panic("assertion failed")
}
}
@@ -63,7 +63,7 @@ func (x s[T]) g2() (T, T) {
}
func methodExpressions() {
- x := s[int]{a:7}
+ x := s[int]{a: 7}
f0 := s[int].g0
f0(x)
f1 := s[int].g1
@@ -73,7 +73,7 @@ func methodExpressions() {
}
func methodValues() {
- x := s[int]{a:7}
+ x := s[int]{a: 7}
f0 := x.g0
f0()
f1 := x.g1
@@ -82,20 +82,20 @@ func methodValues() {
is77(f2())
}
-var x interface{
+var x interface {
g0()
- g1()int
- g2()(int,int)
-} = s[int]{a:7}
-var y interface{} = s[int]{a:7}
+ g1() int
+ g2() (int, int)
+} = s[int]{a: 7}
+var y interface{} = s[int]{a: 7}
func interfaceMethods() {
x.g0()
is7(x.g1())
is77(x.g2())
- y.(interface{g0()}).g0()
- is7(y.(interface{g1()int}).g1())
- is77(y.(interface{g2()(int,int)}).g2())
+ y.(interface{ g0() }).g0()
+ is7(y.(interface{ g1() int }).g1())
+ is77(y.(interface{ g2() (int, int) }).g2())
}
// Also check for instantiations outside functions.
@@ -107,7 +107,7 @@ var hh0 = s[int].g0
var hh1 = s[int].g1
var hh2 = s[int].g2
-var xtop = s[int]{a:7}
+var xtop = s[int]{a: 7}
var ii0 = x.g0
var ii1 = x.g1
var ii2 = x.g2
@@ -116,7 +116,7 @@ func globals() {
gg0(7)
is7(gg1(7))
is77(gg2(7))
- x := s[int]{a:7}
+ x := s[int]{a: 7}
hh0(x)
is7(hh1(x))
is77(hh2(x))