Files
deep_go/lessons/generics_and_reflection/generic_method_set/main.go

16 lines
159 B
Go

package main
type S struct{}
func (S) Bar() {}
type C interface {
S
Foo()
}
func foobar[T C](value T) {
value.Foo()
value.Bar() // compilation error
}