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