]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: extract typecheckarraylit function
authorMatthew Dempsky <mdempsky@google.com>
Thu, 26 Sep 2019 19:29:09 +0000 (12:29 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 26 Sep 2019 20:44:28 +0000 (20:44 +0000)
commitf672e221fc40a376d1b4dc57bd7dda9d3b4f8807
treedc9e08ddcf9ef144f36be569c54402fa6d4ff6b0
parent740d2c8c2250355d22a7c70698f55eeb6894d1ce
cmd/compile: extract typecheckarraylit function

Typechecking slice literals, array literals, and array literals using
"..." notation all use very similar logic, but tie into the logic for
checking the OCOMPLIT node in slightly different ways.

By refactoring this function out into a separate helper, it makes it
easier to separate slice and array literals, and the subsequent CL
will further separate array literals that do use "..." notation from
those that do not.

Passes toolstash-check.

Change-Id: I4c572e0d9d08bcc86b5c224bd6f9e1c498726c19
Reviewed-on: https://go-review.googlesource.com/c/go/+/197603
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/typecheck.go