| 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 |
|
| 7 |
package p |
| 8 |
|
| 9 |
type I interface { |
| 10 |
M() |
| 11 |
} |
| 12 |
|
| 13 |
type S struct{} |
| 14 |
|
| 15 |
func (*S) M() {} |
| 16 |
|
| 17 |
type slice []I |
| 18 |
|
| 19 |
func 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 |
} |