aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-02-16 17:44:15 -0800
committerRuss Cox <rsc@golang.org>2010-02-16 17:44:15 -0800
commit7b5789b5848f88da067d27a5cfa4bd62a77b1c12 (patch)
tree79b940681e2072a31d842faefb67e60b790baf91
parent855986d54f7831fa45f3b30cb9732d0d5758fc88 (diff)
downloadgo-7b5789b5848f88da067d27a5cfa4bd62a77b1c12.tar.gz
go-7b5789b5848f88da067d27a5cfa4bd62a77b1c12.zip
gc: undo attempt at fixing recursive interface embedding
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
-rw-r--r--src/cmd/gc/walk.c19
-rw-r--r--test/bugs/bug250.go (renamed from test/fixedbugs/bug250.go)0
-rw-r--r--test/bugs/bug251.go (renamed from test/fixedbugs/bug251.go)0
-rw-r--r--test/fixedbugs/bug195.go4
-rw-r--r--test/fixedbugs/bug256.go16
-rw-r--r--test/golden.out14
6 files changed, 33 insertions, 20 deletions
diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c
index 31d1e3091e..067db0fc77 100644
--- a/src/cmd/gc/walk.c
+++ b/src/cmd/gc/walk.c
@@ -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:
diff --git a/test/fixedbugs/bug250.go b/test/bugs/bug250.go
index cd28642bfc..cd28642bfc 100644
--- a/test/fixedbugs/bug250.go
+++ b/test/bugs/bug250.go
diff --git a/test/fixedbugs/bug251.go b/test/bugs/bug251.go
index f6365f1e63..f6365f1e63 100644
--- a/test/fixedbugs/bug251.go
+++ b/test/bugs/bug251.go
diff --git a/test/fixedbugs/bug195.go b/test/fixedbugs/bug195.go
index 221a2eb098..27bbbd354a 100644
--- a/test/fixedbugs/bug195.go
+++ b/test/fixedbugs/bug195.go
@@ -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
index 0000000000..37fa5f5c80
--- /dev/null
+++ b/test/fixedbugs/bug256.go
@@ -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"
+
+
diff --git a/test/golden.out b/test/golden.out
index cf2297e1a7..22abf0c4bd 100644
--- a/test/golden.out
+++ b/test/golden.out
@@ -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
+==================================================