diff options
author | Russ Cox <rsc@golang.org> | 2012-06-07 03:06:40 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2012-06-07 03:06:40 -0400 |
commit | 6363fc5aa6b3aa1ee8826582c6f7a356aa8e4201 (patch) | |
tree | 22dfa5f23ea6fa0c25f49d48f49b3662812c6fa2 /test/map1.go | |
parent | f18ced3fc9bdb36029d81eb73a1848959e5a84ec (diff) | |
download | go-6363fc5aa6b3aa1ee8826582c6f7a356aa8e4201.tar.gz go-6363fc5aa6b3aa1ee8826582c6f7a356aa8e4201.zip |
cmd/gc: fix type checking loop
CL 4313064 fixed its test case but did not address a
general enough problem:
type T1 struct { F *T2 }
type T2 T1
type T3 T2
could still end up copying the definition of T1 for T2
before T1 was done being evaluated, or T3 before T2
was done.
In order to propagate the updates correctly,
record a copy of an incomplete type for re-execution
once the type is completed. Roll back CL 4313064.
Fixes #3709.
R=ken2
CC=golang-dev, lstoakes
https://golang.org/cl/6301059
Diffstat (limited to 'test/map1.go')
-rw-r--r-- | test/map1.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/map1.go b/test/map1.go index 369e49da5d..6f1a1c8ac0 100644 --- a/test/map1.go +++ b/test/map1.go @@ -41,4 +41,22 @@ var ( _ map[[]int]v // ERROR "invalid map key" _ map[func()]v // ERROR "invalid map key" _ map[map[int]int]v // ERROR "invalid map key" + _ map[T1]v // ERROR "invalid map key" + _ map[T2]v // ERROR "invalid map key" + _ map[T3]v // ERROR "invalid map key" + _ map[T4]v // ERROR "invalid map key" + _ map[T5]v + _ map[T6]v + _ map[T7]v + _ map[T8]v ) + +type T1 []int +type T2 struct { F T1 } +type T3 []T4 +type T4 struct { F T3 } + +type T5 *int +type T6 struct { F T5 } +type T7 *T4 +type T8 struct { F *T7 } |