mirror of
https://github.com/golang/go
synced 2024-11-22 15:54:52 -07:00
03a1810473
CL 440455 fixed missing walk pass for static initialization slice. However, slicelit may produce un-typechecked node, thus we need to do typecheck for sinit before calling walkStmtList. Fixes #56727 Change-Id: I40730cebcd09f2be4389d71c5a90eb9a060e4ab7 Reviewed-on: https://go-review.googlesource.com/c/go/+/450215 Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
46 lines
491 B
Go
46 lines
491 B
Go
// compile
|
|
|
|
// Copyright 2022 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
|
|
|
|
type I interface {
|
|
M()
|
|
}
|
|
|
|
type S struct{}
|
|
|
|
func (*S) M() {}
|
|
|
|
type slice []I
|
|
|
|
func f() {
|
|
ss := struct {
|
|
i I
|
|
}{
|
|
i: &S{},
|
|
}
|
|
|
|
_ = [...]struct {
|
|
s slice
|
|
}{
|
|
{
|
|
s: slice{ss.i},
|
|
},
|
|
{
|
|
s: slice{ss.i},
|
|
},
|
|
{
|
|
s: slice{ss.i},
|
|
},
|
|
{
|
|
s: slice{ss.i},
|
|
},
|
|
{
|
|
s: slice{ss.i},
|
|
},
|
|
}
|
|
}
|