Source file
test/decl.go
1
2
3
4
5
6
7
8
9 package main
10
11 func f1() int { return 1 }
12 func f2() (float32, int) { return 1, 2 }
13 func f3() (float32, int, string) { return 1, 2, "3" }
14
15 func x() (s string) {
16 a, b, s := f3()
17 _, _ = a, b
18 return
19 }
20
21 func main() {
22 i, f, s := f3()
23 j, f := f2()
24 k := f1()
25 m, g, s := f3()
26 m, h, s := f3()
27 {
28
29 i, f, s := f3()
30 j, f := f2()
31 k := f1()
32 m, g, s := f3()
33 m, h, s := f3()
34 _, _, _, _, _, _, _, _, _ = i, f, s, j, k, m, g, s, h
35 }
36 if y := x(); y != "3" {
37 println("x() failed", y)
38 panic("fail")
39 }
40 _, _, _, _, _, _, _, _, _ = i, f, s, j, k, m, g, s, h
41 }
42
View as plain text