aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-10-01 15:11:22 -0700
committerIan Lance Taylor <iant@golang.org>2020-10-01 16:10:17 -0700
commit3e52eaab8c57ad06bcd553f140923a34e5749991 (patch)
treeaefb9c7afe93c5278b9850695b7bd04af33cd99b /libgo
parent4c69e61f4307865b95151006e480ae2022b30454 (diff)
downloadgcc-3e52eaab8c57ad06bcd553f140923a34e5749991.zip
gcc-3e52eaab8c57ad06bcd553f140923a34e5749991.tar.gz
gcc-3e52eaab8c57ad06bcd553f140923a34e5749991.tar.bz2
compiler: set varargs correctly for type of method expression
Fixes golang/go#41737 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/258977
Diffstat (limited to 'libgo')
-rw-r--r--libgo/go/reflect/all_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/libgo/go/reflect/all_test.go b/libgo/go/reflect/all_test.go
index ee37359..68efab6 100644
--- a/libgo/go/reflect/all_test.go
+++ b/libgo/go/reflect/all_test.go
@@ -2396,8 +2396,14 @@ func TestVariadicMethodValue(t *testing.T) {
points := []Point{{20, 21}, {22, 23}, {24, 25}}
want := int64(p.TotalDist(points[0], points[1], points[2]))
+ // Variadic method of type.
+ tfunc := TypeOf((func(Point, ...Point) int)(nil))
+ if tt := TypeOf(p).Method(4).Type; tt != tfunc {
+ t.Errorf("Variadic Method Type from TypeOf is %s; want %s", tt, tfunc)
+ }
+
// Curried method of value.
- tfunc := TypeOf((func(...Point) int)(nil))
+ tfunc = TypeOf((func(...Point) int)(nil))
v := ValueOf(p).Method(4)
if tt := v.Type(); tt != tfunc {
t.Errorf("Variadic Method Type is %s; want %s", tt, tfunc)