]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] Add CONVIFACE nodes in noder2, where possible
authorDan Scales <danscales@google.com>
Wed, 21 Jul 2021 23:23:17 +0000 (16:23 -0700)
committerDan Scales <danscales@google.com>
Fri, 23 Jul 2021 20:57:41 +0000 (20:57 +0000)
commit12866bd8ea13e43bc5995f58cdeb67ffd64a1c8c
treed57f6807409e9814c6020f1628487adf6fc8b516
parent4cdc65d32a3f0378cc508e8eb395063b83683fd4
[dev.typeparams] Add CONVIFACE nodes in noder2, where possible

Changes to add CONVIFACE nodes where possible in noder2, even when the
args are typeparams. The transformation to insert a CONVIFACE node can
usually happen when there an obvious assignment/conversion to an
interface type from a non-interface type. So, we now do this
tranformation for:

 - direct conversions to an interface type

 - function arguments that are implicitly converted to an interface
   based on the parameter types.

 - EQ/NE comparison of an interface and a non-interface

With this change, we can remove some special case checks for CONVIFACE
nodes after transformation in node(), and instead just have the one
check in the CONVIFACE check.

Change-Id: I7cf2ef920aebf9e5553210aeaf19f344e128ca62
Reviewed-on: https://go-review.googlesource.com/c/go/+/336992
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/noder/helpers.go
src/cmd/compile/internal/noder/stencil.go
src/cmd/compile/internal/noder/transform.go