mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] cmd/compile: implement generic .(T) operations
Introduce new dynamic dottype operations which take a dynamic instead of static type to convert to. Change-Id: I5824a1fea056fe811b1226ce059e1e8da1baa335 Reviewed-on: https://go-review.googlesource.com/c/go/+/337609 Trust: Keith Randall <khr@golang.org> Trust: Dan Scales <danscales@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com>
This commit is contained in:
parent
4a47e40a14
commit
f4f503e0a3
11 changed files with 209 additions and 53 deletions
|
|
@ -74,6 +74,10 @@ func (e *escape) exprSkipInit(k hole, n ir.Node) {
|
|||
case ir.ODOTTYPE, ir.ODOTTYPE2:
|
||||
n := n.(*ir.TypeAssertExpr)
|
||||
e.expr(k.dotType(n.Type(), n, "dot"), n.X)
|
||||
case ir.ODYNAMICDOTTYPE, ir.ODYNAMICDOTTYPE2:
|
||||
n := n.(*ir.DynamicTypeAssertExpr)
|
||||
e.expr(k.dotType(n.Type(), n, "dot"), n.X)
|
||||
// n.T doesn't need to be tracked; it always points to read-only storage.
|
||||
case ir.OINDEX:
|
||||
n := n.(*ir.IndexExpr)
|
||||
if n.X.Type().IsArray() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue