Rob Pike | 83976e3 | 2012-02-19 14:28:53 +1100 | [diff] [blame] | 1 | // compile |
Russ Cox | 5ed04d7 | 2008-09-30 14:08:43 -0700 | [diff] [blame] | 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 | 83976e3 | 2012-02-19 14:28:53 +1100 | [diff] [blame] | 7 | // Test function signatures. |
| 8 | // Compiled but not run. |
| 9 | |
Russ Cox | 5ed04d7 | 2008-09-30 14:08:43 -0700 | [diff] [blame] | 10 | package main |
Russ Cox | 5ed04d7 | 2008-09-30 14:08:43 -0700 | [diff] [blame] | 11 | |
Rob Pike | 4f61fc9 | 2010-09-04 10:36:13 +1000 | [diff] [blame] | 12 | type t1 int |
| 13 | type t2 int |
| 14 | type t3 int |
Russ Cox | 5ed04d7 | 2008-09-30 14:08:43 -0700 | [diff] [blame] | 15 | |
Rob Pike | 4f61fc9 | 2010-09-04 10:36:13 +1000 | [diff] [blame] | 16 | func f1(t1, t2, t3) |
| 17 | func f2(t1, t2, t3 bool) |
| 18 | func f3(t1, t2, x t3) |
| 19 | func f4(t1, *t3) |
| 20 | func (x *t1) f5(y []t2) (t1, *t3) |
| 21 | func f6() (int, *string) |
| 22 | func f7(*t2, t3) |
| 23 | func f8(os int) int |
Russ Cox | 5ed04d7 | 2008-09-30 14:08:43 -0700 | [diff] [blame] | 24 | |
| 25 | func f9(os int) int { |
| 26 | return os |
| 27 | } |
Russ Cox | 44526cd | 2011-11-01 22:06:05 -0400 | [diff] [blame] | 28 | func f10(err error) error { |
Russ Cox | 5ed04d7 | 2008-09-30 14:08:43 -0700 | [diff] [blame] | 29 | return err |
| 30 | } |
| 31 | func f11(t1 string) string { |
| 32 | return t1 |
| 33 | } |