codekingpro/portable-devtools
114k
1// run2 3// Copyright 2021 The Go Authors. All rights reserved.4// Use of this source code is governed by a BSD-style5// license that can be found in the LICENSE file.6 7package main8 9type Foo[T any] interface {10 CreateBar() Bar[T]11}12 13type Bar[T any] func() Bar[T]14 15func (f Bar[T]) CreateBar() Bar[T] {16 return f17}18 19func abc[T any]() {20 var b Bar[T] = func() Bar[T] {21 var b Bar[T]22 return b23 }24 var _ Foo[T] = b()25}26 27func main() {28 abc[int]()29}30 