2012-02-18 21:15:42 +00:00
|
|
|
// run
|
2008-10-04 00:06:24 +00:00
|
|
|
|
|
|
|
// Copyright 2009 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.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
var ncall int;
|
|
|
|
|
2009-01-20 22:40:40 +00:00
|
|
|
type Iffy interface {
|
2008-10-04 00:06:24 +00:00
|
|
|
Me() Iffy
|
|
|
|
}
|
|
|
|
|
2009-01-20 22:40:40 +00:00
|
|
|
type Stucky struct {
|
2008-10-04 00:06:24 +00:00
|
|
|
n int
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stucky) Me() Iffy {
|
2008-10-07 19:31:31 +00:00
|
|
|
ncall++;
|
2008-10-04 00:06:24 +00:00
|
|
|
return s
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
2009-01-06 23:19:02 +00:00
|
|
|
s := new(Stucky);
|
2008-10-04 00:06:24 +00:00
|
|
|
i := s.Me();
|
|
|
|
j := i.Me();
|
|
|
|
j.Me();
|
|
|
|
if ncall != 3 {
|
|
|
|
panic("bug111")
|
|
|
|
}
|
|
|
|
}
|