]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/types2: factor out index/slice expr handling
authorRobert Griesemer <gri@golang.org>
Thu, 8 Apr 2021 00:47:14 +0000 (17:47 -0700)
committerRobert Griesemer <gri@golang.org>
Sat, 10 Apr 2021 19:02:05 +0000 (19:02 +0000)
commit36c5f902f9049b82da50ac66049371830e6de031
treebbd636934391e7783ddbf32121c3c9da9c039b67
parent4638545d85d7e10e49132ee94ff9a6778db1c893
cmd/compile/internal/types2: factor out index/slice expr handling

First step towards lightening the load of Checker.exprInternal by
factoring out the code for index and slice expressions; incl. moving
a couple of related methods (Checker.index, Checker.indexedElts).

The code for handling index/slice expressions is copied 1:1 but
occurrences of "goto Error" are replaced by "x.mode = invalid"
followed by a "return".

Change-Id: I44048dcc4851dc5e24f5f169c17f536a37a6a676
Reviewed-on: https://go-review.googlesource.com/c/go/+/308370
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/expr.go
src/cmd/compile/internal/types2/index.go [new file with mode: 0644]