]> Cypherpunks repositories - gostls13.git/commit
go/gcimporter: fix importing of anonymous interfaces
authorRobert Griesemer <gri@golang.org>
Thu, 20 Apr 2017 19:50:41 +0000 (12:50 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 20 Apr 2017 21:45:01 +0000 (21:45 +0000)
commit950fa673a57ed2e55d1c992c7c34c6d251cb88fd
treeb4b6a493ba689d389570b7d8eb8d470e68e40308
parentda75700a641c7e2bd264dd873d637abfcbfffab1
go/gcimporter: fix importing of anonymous interfaces

Imported interfaces must be completed, whether they are named or not.
The original code was collecting all types (including anonymous ones)
in the importer's typList. That list was used in the end to complete
interface types. When we introduced tracking of named types only, we
lost anonymous interfaces. Use an independent list of interface types
so the completion code is independent of which types are tracked.

Added test and factored some of the existing tests.

Fixes #20046.

Change-Id: Icd1329032aec33f96890380dd5042de3bef8cdc7
Reviewed-on: https://go-review.googlesource.com/41198
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/go/internal/gcimporter/bimport.go
src/go/internal/gcimporter/gcimporter_test.go
src/go/internal/gcimporter/testdata/issue20046.go [new file with mode: 0644]