Debian Codegraph @

_test/issue-1205.go

raw symbols SCIP
1 package main
2
3 type Option interface {
4 apply()
5 }
6
7 func f(opts ...Option) {
8 for _, opt := range opts {
9 opt.apply()
10 }
11 }
12
13 type T struct{}
14
15 func (t *T) apply() { println("in apply") }
16
17 func main() {
18 opt := []Option{&T{}}
19 f(opt[0]) // works
20 f(opt...) // fails
21 }
22
23 // Output:
24 // in apply
25 // in apply