1// compile 2 3// Copyright 2022 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 7package p 8 9type I interface { 10 M() 11} 12 13type S struct{} 14 15func (*S) M() {} 16 17type slice []I 18 19func f() { 20 ss := struct { 21 i I 22 }{ 23 i: &S{}, 24 } 25 26 _ = [...]struct { 27 s slice 28 }{ 29 { 30 s: slice{ss.i}, 31 }, 32 { 33 s: slice{ss.i}, 34 }, 35 { 36 s: slice{ss.i}, 37 }, 38 { 39 s: slice{ss.i}, 40 }, 41 { 42 s: slice{ss.i}, 43 }, 44 } 45} 46