diff options
Diffstat (limited to 'test/fixedbugs/bug286.go')
-rw-r--r-- | test/fixedbugs/bug286.go | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/test/fixedbugs/bug286.go b/test/fixedbugs/bug286.go index 94423be81..eb6783856 100644 --- a/test/fixedbugs/bug286.go +++ b/test/fixedbugs/bug286.go @@ -12,16 +12,14 @@ type I interface { f() } - var callee string -var error bool +var error_ bool type T int func (t *T) f() { callee = "f" } func (i *T) g() { callee = "g" } - // test1 and test2 are the same except that in the interface J // the entries are swapped. test2 and test3 are the same except // that in test3 the interface J is declared outside the function. @@ -36,11 +34,10 @@ func test1(x I) { x.(J).f() if callee != "f" { println("test1 called", callee) - error = true + error_ = true } } - func test2(x I) { type J interface { g() @@ -49,11 +46,10 @@ func test2(x I) { x.(J).f() if callee != "f" { println("test2 called", callee) - error = true + error_ = true } } - type J interface { g() I @@ -63,7 +59,7 @@ func test3(x I) { x.(J).f() if callee != "f" { println("test3 called", callee) - error = true + error_ = true } } @@ -72,7 +68,7 @@ func main() { test1(x) test2(x) test3(x) - if error { + if error_ { panic("wrong method called") } } |