mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] cmd/compile: implement generic type switches
Add a new dynamicType node, which is used as a case entry when the type being switched to is generic. Change-Id: Ice77c6f224b8fdd3ff574fdf4a8ea5f6c7ddbe75 Reviewed-on: https://go-review.googlesource.com/c/go/+/339429 Trust: Keith Randall <khr@golang.org> Trust: Dan Scales <danscales@google.com> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Dan Scales <danscales@google.com>
This commit is contained in:
parent
57668b84ff
commit
ca3c6985cd
21 changed files with 342 additions and 18 deletions
|
|
@ -313,6 +313,10 @@ assignOK:
|
|||
r := r.(*ir.TypeAssertExpr)
|
||||
stmt.SetOp(ir.OAS2DOTTYPE)
|
||||
r.SetOp(ir.ODOTTYPE2)
|
||||
case ir.ODYNAMICDOTTYPE:
|
||||
r := r.(*ir.DynamicTypeAssertExpr)
|
||||
stmt.SetOp(ir.OAS2DOTTYPE)
|
||||
r.SetOp(ir.ODYNAMICDOTTYPE2)
|
||||
default:
|
||||
break assignOK
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue