| // Copyright 2010 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. |
| // Issue 481: closures and var declarations |
| // with multiple variables assigned from one |
| var listen, _ = Listen("tcp", "127.0.0.1:0") |
| var conn, _ = listen.Accept() |
| var conn, _ = Dial("tcp", "", listen.Addr().Error()) |
| // Simulated net interface to exercise bug |
| // without involving a real network. |
| func Listen(x, y string) (T, string) { |
| func (t T) Addr() error { |
| return errors.New("stringer") |
| func (t T) Accept() (int, string) { |
| func Dial(x, y, z string) (int, string) { |