]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: handle derived types that are converted to interfaces
authorDan Scales <danscales@google.com>
Tue, 6 Jul 2021 16:38:58 +0000 (09:38 -0700)
committerDan Scales <danscales@google.com>
Wed, 7 Jul 2021 17:40:11 +0000 (17:40 +0000)
commit501725032cb8e0fd5ef75b50f949dda09ce4b441
tree148c9e93e1a9f8a706aab212e8dcd1b67b77b9c3
parentb614c05a151ffc45b8eb5725c9df399aca20663d
[dev.typeparams] cmd/compile: handle derived types that are converted to interfaces

Up to this point, we were only handling typeparams that were converted
to empty or non-empty interfaces. But we have a dictionary entry for
each derived type (i.e. type derived from typeparams) as well. So, when
doing a conversion, look for the source type in both the type params and
derived types of the generic info, and then use the appropriate
dictionary entry.

Added some cases to ifaceconv.go (e.g. converting []T to an empty
interface).

Change-Id: I7bbad0128bec20ccccd93ae1d65c1ffd44ca79a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/333011
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/noder/stencil.go
test/typeparam/ifaceconv.go