You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bug depends on the order in which the compiler sees declarations. Underlying cause
of issue #3707.
$ cat p.go
package p
type T1 struct { F *T2 }
type T2 T1
type T3 T2
func (*T3) M()
$ go tool 6g p.go
p.go:7: invalid receiver type *T3
go tool 6g: exit status 1
But if we swap the two blocks of code:
$ cat p1.go
package p
type T3 T2
func (*T3) M()
type T1 struct { F *T2 }
type T2 T1
$ go tool 6g p1.go
$
The text was updated successfully, but these errors were encountered:
««« backport e69400ace361
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
»»»
The text was updated successfully, but these errors were encountered: