This code:
package main
import "fmt"
type Fooer interface{ Foo() }
type FooGetter[F Fooer] interface{ GetFooer() F }
type A struct{}
func (A) GetFooer() B { return B{} }
type B struct{}
func (B) Foo() {}
func fun[F Fooer, FG FooGetter[F]](a *FG) F {
return a.GetFooer()
}
func main() {
fmt.Printf("%T", fun[B, A](&A{}))
}
works on playground, but doesn't on latest tip. I suspect this is correct behavior since simplified version doesn't compile either on go2go playground. But then, why does go2go permits this code?
This code:
works on playground, but doesn't on latest tip. I suspect this is correct behavior since simplified version doesn't compile either on go2go playground. But then, why does go2go permits this code?