1 // Tests of call chaining f(g()) when g has multiple return values (MRVs).
2 // See https://code.google.com/p/go/issues/detail?id=4573.
6 func assert(actual, expected int) {
7 if actual != expected {
16 func g2() (float64, float64) {
20 func f1v(x int, v ...int) {
30 func f2v(x, y int, v ...int) {
36 func complexArgs() (float64, float64) {
40 func appendArgs() ([]string, string) {
41 return []string{"foo"}, "bar"
44 func h() (i interface{}, ok bool) {
45 m := map[int]string{1: "hi"}
46 i, ok = m[1] // string->interface{} conversion within multi-valued expression
50 func h2() (i interface{}, ok bool) {
51 ch := make(chan string, 1)
53 i, ok = <-ch // string->interface{} conversion within multi-valued expression
61 if c := complex(complexArgs()); c != 5+7i {
64 if s := append(appendArgs()); len(s) != 2 || s[0] != "foo" || s[1] != "bar" {
68 if !ok || i.(string) != "hi" {
72 if !ok || i.(string) != "hi" {