blob: ec25161d13c675c61bb6b21ffc8310a262a80c5f [file] [log] [blame]
Russ Coxd2cc9882012-02-16 23:50:37 -05001// errorcheck
Robert Griesemere92b7532008-06-06 15:53:14 -07002
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.
6
Rob Pike83976e32012-02-19 14:28:53 +11007// Test that result parameters are in the same scope as regular parameters.
8// Does not compile.
Rob Pike6810f392008-07-08 12:22:21 -07009
Robert Griesemere92b7532008-06-06 15:53:14 -070010package main
11
Rob Pike83976e32012-02-19 14:28:53 +110012func f1(a int) (int, float32) {
Rob Pike4f61fc92010-09-04 10:36:13 +100013 return 7, 7.0
Robert Griesemere92b7532008-06-06 15:53:14 -070014}
15
16
Robert Griesemer02820d62020-12-03 18:15:50 -080017func f2(a int) (a int, b float32) { // ERROR "duplicate argument a|definition|redeclared"
Rob Pike4f61fc92010-09-04 10:36:13 +100018 return 8, 8.0
Robert Griesemere92b7532008-06-06 15:53:14 -070019}