Robert Griesemer | e92b753 | 2008-06-06 15:53:14 -0700 | [diff] [blame] | 1 | // errchk $G $F.go |
| 2 | |
| 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 Pike | 6810f39 | 2008-07-08 12:22:21 -0700 | [diff] [blame] | 7 | // does not compile and should not compile |
| 8 | |
Robert Griesemer | e92b753 | 2008-06-06 15:53:14 -0700 | [diff] [blame] | 9 | package main |
| 10 | |
Russ Cox | f2b5a07 | 2011-01-19 23:09:00 -0500 | [diff] [blame] | 11 | func f1(a int) (int, float32) { // BUG (not caught by compiler): multiple return values must have names |
Rob Pike | 4f61fc9 | 2010-09-04 10:36:13 +1000 | [diff] [blame] | 12 | return 7, 7.0 |
Robert Griesemer | e92b753 | 2008-06-06 15:53:14 -0700 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | |
Russ Cox | f2b5a07 | 2011-01-19 23:09:00 -0500 | [diff] [blame] | 16 | func f2(a int) (a int, b float32) { // ERROR "redeclared|definition" |
Rob Pike | 4f61fc9 | 2010-09-04 10:36:13 +1000 | [diff] [blame] | 17 | return 8, 8.0 |
Robert Griesemer | e92b753 | 2008-06-06 15:53:14 -0700 | [diff] [blame] | 18 | } |