3 // Copyright 2021 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.
9 type FooType[T any] interface {
10 Foo(BarType[T]) string
12 type BarType[T any] interface {
13 Bar(FooType[T]) string
16 // For now, a lone type parameter is not permitted as RHS in a type declaration (issue #45639).
18 // func (l Baz[T]) Foo(v BarType[T]) string {
22 // func (l Bob[T]) Bar(v FooType[T]) string {
23 // if v,ok := v.(Baz[T]);ok{
24 // return fmt.Sprintf("%v%v",v,l)
30 // For now, a lone type parameter is not permitted as RHS in a type declaration (issue #45639).
31 // var baz Baz[int] = 123
32 // var bob Bob[int] = 456
34 // if got, want := baz.Foo(bob), "123456"; got != want {
35 // panic(fmt.Sprintf("got %s want %s", got, want))