Commit 130f3c06 authored by Cuong Manh Le's avatar Cuong Manh Le Committed by Matthew Dempsky

cmd/compile: revert change to "bound" in typecheckarraylit

In CL 204617, I intend to make "bound" parameter to have special meaning
in typecheckarraylit, so we can distinguish between type-checks array
literal and slice literal. But we end up with other solution. The CL was
submitted without reverting the "bound" parameter in case of slice
literal.

Technically, it's not harmful, but causes the code harder to read and maintain.

Change-Id: Ia522ccc9a6b8e25d7eaad4aa4957cb4fa18edc60
Reviewed-on: https://go-review.googlesource.com/c/go/+/204618
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
parent 9bde9b4d
......@@ -2809,7 +2809,7 @@ func typecheckcomplit(n *Node) (res *Node) {
n.Right = nil
case TSLICE:
length := typecheckarraylit(t.Elem(), -2, n.List.Slice(), "slice literal")
length := typecheckarraylit(t.Elem(), -1, n.List.Slice(), "slice literal")
n.Op = OSLICELIT
n.Right = nodintconst(length)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment