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|redefinition"
22 // change of type for f
23 i, f, s := f3(); // GCCGO_ERROR "previous"
24 f, g, t := f3(); // ERROR "redeclared|redefinition"
27 // change of type for i
28 i, f, s := f3(); // GCCGO_ERROR "previous"
29 j, i, t := f3(); // ERROR "redeclared|redefinition"
34 i, f := f2(); // ERROR "redeclared|redefinition"
37 // single redeclaration
38 i, f, s := f3(); // GCCGO_ERROR "previous"
39 i := f1(); // ERROR "redeclared|redefinition"
41 // double redeclaration
44 i, f := f2(); // ERROR "redeclared|redefinition"
47 // triple redeclaration
49 i, f, s := f3(); // ERROR "redeclared|redefinition"