summaryrefslogtreecommitdiff
path: root/test/fixedbugs/bug286.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-01-30 15:38:19 +0100
committerOndřej Surý <ondrej@sury.org>2012-01-30 15:38:19 +0100
commit4cecda6c347bd6902b960c6a35a967add7070b0d (patch)
treea462e224ff41ec9f3eb1a0b6e815806f9e8804ad /test/fixedbugs/bug286.go
parent6c7ca6e4d4e26e4c8cbe0d183966011b3b088a0a (diff)
downloadgolang-4cecda6c347bd6902b960c6a35a967add7070b0d.tar.gz
Imported Upstream version 2012.01.27upstream-weekly/2012.01.27
Diffstat (limited to 'test/fixedbugs/bug286.go')
-rw-r--r--test/fixedbugs/bug286.go14
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")
}
}