]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/types2: generalize assignability to generic types
authorRobert Griesemer <gri@golang.org>
Fri, 22 Oct 2021 16:49:15 +0000 (09:49 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 27 Oct 2021 20:24:34 +0000 (20:24 +0000)
commit56dcf976561ff6c666d9d1fe6231557ac2072883
tree01594105a7991ea9d45c4be44492d8ac7b0be261
parent3f1b0ce6bb4f2e7d44791c5532728f86e24f1f1f
cmd/compile/internal/types2: generalize assignability to generic types

Similar to conversions, handle ordinary cases first, followed by
type-by-type assignability tests in case of type parameters with
specific types in their type sets.

Add a new class of type checker tests, in testdata/spec, which
I hope we can populate over time with tests following the spec
organization. Moved the conversions.go2 tests in the same dir.

Change-Id: Iac253ae375c08022bdc39e92e3951ec3f509e432
Reviewed-on: https://go-review.googlesource.com/c/go/+/357917
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/check_test.go
src/cmd/compile/internal/types2/operand.go
src/cmd/compile/internal/types2/testdata/spec/assignability.go2 [new file with mode: 0644]
src/cmd/compile/internal/types2/testdata/spec/conversions.go2 [moved from src/cmd/compile/internal/types2/testdata/examples/conversions.go2 with 100% similarity]