]> Cypherpunks repositories - gostls13.git/commitdiff
gc: undo attempt at fixing recursive interface embedding
authorRuss Cox <rsc@golang.org>
Wed, 17 Feb 2010 01:44:15 +0000 (17:44 -0800)
committerRuss Cox <rsc@golang.org>
Wed, 17 Feb 2010 01:44:15 +0000 (17:44 -0800)
Fixes #582.

Update #287
Status: Accepted
Bug fix was too intrusive; undo and reopen issue.

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

src/cmd/gc/walk.c
test/bugs/bug250.go [moved from test/fixedbugs/bug250.go with 100% similarity]
test/bugs/bug251.go [moved from test/fixedbugs/bug251.go with 100% similarity]
test/fixedbugs/bug195.go
test/fixedbugs/bug256.go [new file with mode: 0644]
test/golden.out

index 31d1e3091e13072b3c1fe9aeb01e0d5e7946421c..067db0fc77796858d1e652b77717cedbc94017ab 100644 (file)
@@ -122,9 +122,6 @@ walkdeflist(NodeList *l)
                walkdef(l->n);
 }
 
-static NodeList *deftypequeue;
-static int intypedef;
-
 static void
 walkdeftype(Node *n)
 {
@@ -265,21 +262,7 @@ walkdef(Node *n)
                n->walkdef = 1;
                n->type = typ(TFORW);
                n->type->sym = n->sym;
-               intypedef++;
-               if(intypedef > 1)
-                       deftypequeue = list(deftypequeue, n);
-               else {
-                       walkdeftype(n);
-                       while(deftypequeue != nil) {
-                               NodeList *l;
-                               
-                               l = deftypequeue;
-                               deftypequeue = nil;
-                               for(; l; l=l->next)
-                                       walkdeftype(l->n);
-                       }
-               }
-               intypedef--;
+               walkdeftype(n);
                break;
 
        case OPACK:
similarity index 100%
rename from test/fixedbugs/bug250.go
rename to test/bugs/bug250.go
similarity index 100%
rename from test/fixedbugs/bug251.go
rename to test/bugs/bug251.go
index 221a2eb0986a42f172c205225f30f2ad7561802e..27bbbd354a62430a817b3d4fb497f6c7e6f99139 100644 (file)
@@ -19,9 +19,9 @@ type I4 interface {
 }
 
 type I5 interface {
-       I6      // ERROR "interface"
+       I6
 }
 
 type I6 interface {
-       I5
+       I5      // ERROR "interface"
 }
diff --git a/test/fixedbugs/bug256.go b/test/fixedbugs/bug256.go
new file mode 100644 (file)
index 0000000..37fa5f5
--- /dev/null
@@ -0,0 +1,16 @@
+// errchk $G -e $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.
+
+package main
+
+type T U       // bogus "invalid recursive type T" from 6g
+type U int
+
+const x T = 123
+
+type V V       // ERROR "invalid recursive type"
+
+
index cf2297e1a73e4715517199946c8d2bf5c288017c..22abf0c4bd88c31379678d360cb48e39929036c6 100644 (file)
@@ -150,3 +150,17 @@ throw: interface conversion
 panic PC=xxx
 
 == bugs/
+
+=========== bugs/bug250.go
+bugs/bug250.go:14: interface type loop involving I1
+bugs/bug250.go:17: need type assertion to use I2 as I1
+       missing m() I2
+BUG: bug250
+
+=========== bugs/bug251.go
+BUG: errchk: bugs/bug251.go:11: missing expected error: 'loop|interface'
+errchk: bugs/bug251.go: unmatched error messages:
+==================================================
+bugs/bug251.go:15: interface type loop involving I1
+bugs/bug251.go:19: need type assertion to use I2 as I1
+==================================================