]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/gc: handle recursive interfaces better
authorMatthew Dempsky <mdempsky@google.com>
Mon, 20 Mar 2017 18:56:15 +0000 (11:56 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 21 Mar 2017 01:56:25 +0000 (01:56 +0000)
commit07de3465be8efafd66c96552de38c2cbb5851f28
tree1098a1c3e9a65168165648ed928a21254e537def
parent4e35e5fcabb504a14b9533692c9ae1a8c38b1139
cmd/compile/internal/gc: handle recursive interfaces better

Previously, we handled recursive interfaces by deferring typechecking
of interface methods, while eagerly expanding interface embeddings.

This CL switches to eagerly evaluating interface methods, and
deferring expanding interface embeddings to dowidth. This allows us to
detect recursive interface embeddings with the same mechanism used for
detecting recursive struct embeddings.

Updates #16369.

Change-Id: If4c0320058047f8a2d9b52b9a79de47eb9887f95
Reviewed-on: https://go-review.googlesource.com/38391
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/align.go
src/cmd/compile/internal/gc/bimport.go
src/cmd/compile/internal/gc/dcl.go
src/cmd/compile/internal/gc/fmt.go
src/cmd/compile/internal/gc/type.go
src/cmd/compile/internal/gc/typecheck.go
test/fixedbugs/bug195.go
test/fixedbugs/bug251.go
test/fixedbugs/issue18392.go