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 A[T any] struct {10 field B[T]11}12 13type B[T any] interface {14 Work(T)15}16 17func (a *A[T]) Work(t T) {18 a.field.Work(t)19}20 21type BImpl struct{}22 23func (b BImpl) Work(s string) {}24 25func main() {26 a := &A[string]{27 field: BImpl{},28 }29 a.Work("")30}31 