3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Incorrect short declarations and redeclarations.
11 func f1() int { return 1 }
12 func f2() (float, int) { return 1, 2 }
13 func f3() (float, int, string) { return 1, 2, "3" }
17 // simple redeclaration
19 i := f1(); // ERROR "redeclared|no new"
23 // change of type for f
25 f, g, t := f3(); // ERROR "redeclared|cannot assign|incompatible"
26 _, _, _, _, _ = i, f, s, g, t;
29 // change of type for i
31 j, i, t := f3(); // ERROR "redeclared|cannot assign|incompatible"
32 _, _, _, _, _ = i, f, s, j, t;
37 i, f := f2(); // ERROR "redeclared|no new"
41 // single redeclaration
43 i := f1(); // ERROR "redeclared|no new|incompatible"
46 // double redeclaration
49 i, f := f2(); // ERROR "redeclared|no new"
53 // triple redeclaration
55 i, f, s := f3(); // ERROR "redeclared|no new"