mirror of
https://github.com/golang/go
synced 2024-09-04 23:44:16 +00:00
![Cuong Manh Le](/assets/img/avatar_default.png)
When seeing Key:Value expression in slice literal, the compiler only needs to emit tmp var for the Value, not the whole expression. Fixes #49240 Change-Id: I7bda3c796a93c0fa1974f7c5930f38025dfa665c Reviewed-on: https://go-review.googlesource.com/c/go/+/360055 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
12 lines
227 B
Go
12 lines
227 B
Go
// compile
|
|
|
|
// Copyright 2021 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package p
|
|
|
|
func f() {
|
|
go copy([]int{1: 0}, []int{})
|
|
}
|