]> Cypherpunks repositories - gostls13.git/commitdiff
gc: bug270
authorRuss Cox <rsc@golang.org>
Fri, 30 Apr 2010 20:04:16 +0000 (13:04 -0700)
committerRuss Cox <rsc@golang.org>
Fri, 30 Apr 2010 20:04:16 +0000 (13:04 -0700)
Fixes #746.

R=ken2
CC=golang-dev
https://golang.org/cl/1040042

src/cmd/gc/walk.c
test/fixedbugs/bug270.go [new file with mode: 0644]

index 5768285b84bc06e5a5d03dae49b7bf62f3685222..f845638e88458bf380cdd72a54796ee281209433 100644 (file)
@@ -803,11 +803,8 @@ walkexpr(Node **np, NodeList **init)
                switch(et) {
                case I2Isame:
                case E2Esame:
-                       n->rlist = list(list1(r->left), nodbool(1));
-                       typechecklist(n->rlist, Erv);
-                       goto as2;
                case I2E:
-                       n->list = list(list1(n->right), nodbool(1));
+                       n->rlist = list(list1(r->left), nodbool(1));
                        typechecklist(n->rlist, Erv);
                        goto as2;
                case I2T:
diff --git a/test/fixedbugs/bug270.go b/test/fixedbugs/bug270.go
new file mode 100644 (file)
index 0000000..a9cda7b
--- /dev/null
@@ -0,0 +1,21 @@
+// $G $D/$F.go
+
+// 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.
+
+// http://code.google.com/p/go/issues/detail?id=746
+
+package main
+
+type I interface { F() }
+
+type T struct{}
+
+func (T) F() {}
+
+func main() {
+       switch I(T{}).(type) {
+       case interface{}:
+       }
+}