Commit c35c6720 authored by Robert Griesemer's avatar Robert Griesemer

go/types: fix (some) builds

The position (type) for which the "invalid cycle" error
message is reported depends on which type in a cycle of
types is first checked. Which one is first depends on
the iteration order of maps which is different on
different platforms. For now, disable this error message.

R=rsc
CC=golang-dev
https://golang.org/cl/4527059
parent 9ada841f
...@@ -118,7 +118,10 @@ func (c *checker) makeType(x ast.Expr, cycleOk bool) (typ Type) { ...@@ -118,7 +118,10 @@ func (c *checker) makeType(x ast.Expr, cycleOk bool) (typ Type) {
} }
c.checkObj(obj, cycleOk) c.checkObj(obj, cycleOk)
if !cycleOk && obj.Type.(*Name).Underlying == nil { if !cycleOk && obj.Type.(*Name).Underlying == nil {
msg := c.errorf(obj.Pos(), "illegal cycle in declaration of %s", obj.Name) // TODO(gri) Enable this message again once its position
// is independent of the underlying map implementation.
// msg := c.errorf(obj.Pos(), "illegal cycle in declaration of %s", obj.Name)
msg := "illegal cycle"
return &Bad{Msg: msg} return &Bad{Msg: msg}
} }
return obj.Type.(Type) return obj.Type.(Type)
......
...@@ -39,7 +39,7 @@ type ( ...@@ -39,7 +39,7 @@ type (
type ( type (
Pi pi /* ERROR "not a type" */ Pi pi /* ERROR "not a type" */
a /* ERROR "illegal cycle" */ a a /* DISABLED "illegal cycle" */ a
a /* ERROR "redeclared" */ int a /* ERROR "redeclared" */ int
// where the cycle error appears depends on the // where the cycle error appears depends on the
...@@ -47,7 +47,7 @@ type ( ...@@ -47,7 +47,7 @@ type (
// (which depends on the order in which a map // (which depends on the order in which a map
// is iterated through) // is iterated through)
b c b c
c /* ERROR "illegal cycle" */ d c /* DISABLED "illegal cycle" */ d
d e d e
e b e b
...@@ -74,13 +74,13 @@ type ( ...@@ -74,13 +74,13 @@ type (
S3 struct { S3 struct {
x S2 x S2
} }
S4/* ERROR "illegal cycle" */ struct { S4/* DISABLED "illegal cycle" */ struct {
S4 S4
} }
S5 struct { S5 struct {
S6 S6
} }
S6 /* ERROR "illegal cycle" */ struct { S6 /* DISABLED "illegal cycle" */ struct {
field S7 field S7
} }
S7 struct { S7 struct {
...@@ -91,8 +91,8 @@ type ( ...@@ -91,8 +91,8 @@ type (
L2 []int L2 []int
A1 [10]int A1 [10]int
A2 /* ERROR "illegal cycle" */ [10]A2 A2 /* DISABLED "illegal cycle" */ [10]A2
A3 /* ERROR "illegal cycle" */ [10]struct { A3 /* DISABLED "illegal cycle" */ [10]struct {
x A4 x A4
} }
A4 [10]A3 A4 [10]A3
...@@ -127,10 +127,10 @@ type ( ...@@ -127,10 +127,10 @@ type (
I1 I1
I1 I1
} }
I8 /* ERROR "illegal cycle" */ interface { I8 /* DISABLED "illegal cycle" */ interface {
I8 I8
} }
I9 /* ERROR "illegal cycle" */ interface { I9 /* DISABLED "illegal cycle" */ interface {
I10 I10
} }
I10 interface { I10 interface {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment