blob: 81041551c8841bcd211c77a3eb7661cb12f15d47 [file] [log] [blame]
Chris Manghane671cc6e2014-03-05 14:16:21 -05001// run
2
Emmanuel Odeke53fd5222016-04-10 14:32:26 -07003// Copyright 2013 The Go Authors. All rights reserved.
Chris Manghane671cc6e2014-03-05 14:16:21 -05004// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7// Issue 5793: calling 2-arg builtin with multiple-result f() call expression gives
8// spurious error.
9
10package main
11
12func complexArgs() (float64, float64) {
13 return 5, 7
14}
15
16func appendArgs() ([]string, string) {
17 return []string{"foo"}, "bar"
18}
19
20func appendMultiArgs() ([]byte, byte, byte) {
21 return []byte{'a', 'b'}, '1', '2'
22}
23
24func main() {
25 if c := complex(complexArgs()); c != 5+7i {
26 panic(c)
27 }
28
29 if s := append(appendArgs()); len(s) != 2 || s[0] != "foo" || s[1] != "bar" {
30 panic(s)
31 }
32
33 if b := append(appendMultiArgs()); len(b) != 4 || b[0] != 'a' || b[1] != 'b' || b[2] != '1' || b[3] != '2' {
34 panic(b)
35 }
36}