mirror of https://github.com/golang/go.git
cmd/compile: handle ODDD in exprformat
Fixes #41247 Change-Id: Iaa9502cc610e2cc64be5dfd91ba3187f86f87cbd Reviewed-on: https://go-review.googlesource.com/c/go/+/252942 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
0e19aaabc0
commit
dc025c0f9b
|
|
@ -1616,7 +1616,8 @@ func (n *Node) exprfmt(s fmt.State, prec int, mode fmtMode) {
|
|||
}
|
||||
n1.exprfmt(s, nprec, mode)
|
||||
}
|
||||
|
||||
case ODDD:
|
||||
mode.Fprintf(s, "...")
|
||||
default:
|
||||
mode.Fprintf(s, "<node %v>", n.Op)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
// errorcheck
|
||||
|
||||
// Copyright 2020 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() [2]int {
|
||||
return [...]int{2: 0} // ERROR "cannot use \[\.\.\.\]int literal \(type \[3\]int\)"
|
||||
}
|
||||
Loading…
Reference in New Issue