| // Copyright 2009 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // Incorrect short declarations and redeclarations. |
| func f1() int { return 1 } |
| func f2() (float32, int) { return 1, 2 } |
| func f3() (float32, int, string) { return 1, 2, "3" } |
| i := f1() // ERROR "redeclared|no new" |
| f, g, t := f3() // ERROR "redeclared|cannot assign|incompatible" |
| _, _, _, _, _ = i, f, s, g, t |
| j, i, t := f3() // ERROR "redeclared|cannot assign|incompatible" |
| _, _, _, _, _ = i, f, s, j, t |
| i, f := f2() // ERROR "redeclared|no new" |
| i := f1() // ERROR "redeclared|no new|incompatible" |
| i, f := f2() // ERROR "redeclared|no new" |
| i, f, s := f3() // ERROR "redeclared|no new" |