]> Cypherpunks.ru repositories - gostls13.git/commit
go/internal/gcimporter: add import tests for type parameters
authorRobert Findley <rfindley@google.com>
Wed, 1 Sep 2021 20:51:17 +0000 (16:51 -0400)
committerRobert Findley <rfindley@google.com>
Thu, 2 Sep 2021 14:05:36 +0000 (14:05 +0000)
commit4fb79569d2fb7a0eabc88729f400addb0162f21e
treeb97fe5ba0d20ee1e12086e0ab5a81bf7cb6e7f74
parentb8420baf4610e71f6893f7e8b1ad2b6aa94f3eef
go/internal/gcimporter: add import tests for type parameters

Add a new test TestImportTypeparamTests that compiles and imports
packages contained in test/typeparam, and compares the resulting package
scope with the scope produced by type-checking directly.

In the process, fix a bug in go/types affecting embedded instances with
more than one type argument. This was uncovered by smoketest.go.

To enable this new test it was easiest to move gcimporter_test.go to an
external test, which required copying the pkgExts variable.

Fixes #48101

Change-Id: Ie4d981bf463e886a8d141809805d184dbbf64607
Reviewed-on: https://go-review.googlesource.com/c/go/+/347070
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/internal/gcimporter/gcimporter_test.go
src/go/types/struct.go