Skip to content

Commit 320aabb

Browse files
odeke-emmdempsky
authored andcommitted
cmd/compile: add test for blank field in composite literal
Updates #18089. Test for that issue; it was inadvertently fixed by CL 34988. Ensure that we don't regress on the fix. Change-Id: Icb85fc20dbb0a47f028f088281319b552b16759d Reviewed-on: https://go-review.googlesource.com/42173 Reviewed-by: Matthew Dempsky <[email protected]> Run-TryBot: Matthew Dempsky <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 34fd5db commit 320aabb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/fixedbugs/issue18089.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// compile
2+
3+
// Copyright 2017 The Go Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style
5+
// license that can be found in the LICENSE file.
6+
7+
package foo
8+
9+
type T struct {
10+
x int
11+
_ int
12+
}
13+
14+
func main() {
15+
_ = T{0, 0}
16+
17+
x := T{1, 1}
18+
_ = x
19+
}

0 commit comments

Comments
 (0)