Rémy Oudompheng | 2ece2f5 | 2012-02-18 22:15:42 +0100 | [diff] [blame] | 1 | // compile |
Ian Lance Taylor | 42e9db1 | 2009-08-17 19:23:17 -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 | |||||
7 | package main | ||||
8 | |||||
9 | type S struct { | ||||
10 | p *S; | ||||
11 | s []S; | ||||
12 | m map[int] S; | ||||
13 | c chan S; | ||||
14 | i interface { f(S); }; | ||||
15 | f func(S) S; | ||||
16 | } | ||||
17 | |||||
18 | func main() { | ||||
19 | var s S; | ||||
20 | s.p = &s; | ||||
21 | s.s = make([]S, 1); | ||||
22 | s.s[0] = s; | ||||
23 | s.m[0] = s; | ||||
24 | s.c <- s; | ||||
25 | s.i.f(s); | ||||
26 | } |