diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2022-06-03 14:30:04 -0700 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2022-06-09 20:52:47 +0000 |
| commit | 8ef8b60e1816e0624fc894df90c853772d5059bb (patch) | |
| tree | cf0d8246ebe5642e599fdadb3adc9f6a5b2f9ce8 /src/cmd/compile/internal/noder/codes.go | |
| parent | 1a6c96bb9b0e1674048758d4c92e33fb03c4833e (diff) | |
| download | go-8ef8b60e1816e0624fc894df90c853772d5059bb.tar.xz | |
[dev.unified] cmd/compile/internal/noder: stop handling type expressions as expressions
There are two places currently where we rely on type expressions as
generic expressions: the first argument to "make" and "new", and the
selectable operand within a method expression.
This CL makes that code responsible for handling the type expressions
directly. Longer term, this will be relevant to appropriately handling
derived types, because it will provide additional context about how
the derived type is to be used.
Change-Id: I9d7dcf9d32dada032ff411cd103b9df413c298a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/410101
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/noder/codes.go')
| -rw-r--r-- | src/cmd/compile/internal/noder/codes.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/noder/codes.go b/src/cmd/compile/internal/noder/codes.go index 581eb8344f..59c8ec8121 100644 --- a/src/cmd/compile/internal/noder/codes.go +++ b/src/cmd/compile/internal/noder/codes.go @@ -39,7 +39,6 @@ func (c codeExpr) Value() int { return int(c) } // TODO(mdempsky): Split expr into addr, for lvalues. const ( exprConst codeExpr = iota - exprType // type expression exprLocal // local variable exprGlobal // global variable or function exprCompLit @@ -52,6 +51,8 @@ const ( exprBinaryOp exprCall exprConvert + exprNew + exprMake ) type codeAssign int |
