]> Cypherpunks repositories - gostls13.git/commit
go/types: make sure interfaces are complete before comparing them
authorRobert Griesemer <gri@golang.org>
Mon, 16 Sep 2019 21:34:02 +0000 (14:34 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 17 Sep 2019 23:16:18 +0000 (23:16 +0000)
commit04fb929a5b7991ed0945d05ab8015c1721958d82
treebc01628d2345e3c9bd1e72c6a168df8b8897bf27
parent5cc64141e738b008b62d0698cdbadf2b9aead72d
go/types: make sure interfaces are complete before comparing them

Complete interfaces before comparing them with Checker.identical.
This requires passing through a *Checker to various functions that
didn't need this before.

Verified that none of the exported API entry points for interfaces
that rely on completed interfaces are used internally except for
Interface.Empty. Verified that interfaces are complete before
calling Empty on them, and added a dynamic check in the exported
functions.

Unfortunately, this fix exposed another problem with an esoteric
test case (#33656) which we need to reopen.

Fixes #34151.
Updates #33656.

Change-Id: I4e14bae3df74a2c21b565c24fdd07135f22e11c0
Reviewed-on: https://go-review.googlesource.com/c/go/+/195837
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
14 files changed:
src/go/types/builtins.go
src/go/types/call.go
src/go/types/conversions.go
src/go/types/expr.go
src/go/types/issues_test.go
src/go/types/lookup.go
src/go/types/methodset.go
src/go/types/operand.go
src/go/types/predicates.go
src/go/types/stdlib_test.go
src/go/types/stmt.go
src/go/types/testdata/cycles2.src
src/go/types/type.go
src/go/types/typexpr.go