]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: fix interface receiver type for incremental type-checking
authorRobert Griesemer <gri@golang.org>
Mon, 3 Dec 2018 21:46:14 +0000 (13:46 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 3 Dec 2018 22:32:54 +0000 (22:32 +0000)
commit13e40c76dfdc87071d9a609906d3a842ae636d6f
tree33253317d0acd48a0ad69c198c6226be7123c0eb
parent48399cae9f828668bd2c010dc46e4767f2acd011
go/types: fix interface receiver type for incremental type-checking

The type checker may be called incrementally (by repeatedly calling
Checker.Files), for instance when adding _test.go files to a set of
already checked files.

The existing code reset a cache of (already computed) interface
information with each Checker.Files call, causing interfaces to be
recomputed in some cases, albeit with different receiver information
(see comments in this CL for details).

Don't reset the interface cache to avoid this problem.

While adding a test case, also factor out some common testing logic.

Fixes #29029.

Change-Id: I2e2d6d6bb839b3a76522fbc4ba7355c71d3bb80b
Reviewed-on: https://go-review.googlesource.com/c/152259
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/types/check.go
src/go/types/interfaces.go
src/go/types/issues_test.go