Source file test/typeparam/issue48056.go

     1  // compile
     2  
     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.
     6  
     7  package p
     8  
     9  type B[T any] interface {
    10  	Work()
    11  }
    12  type BImpl[T any] struct{}
    13  
    14  func (b *BImpl[T]) Work() {
    15  }
    16  
    17  type A[T any] struct {
    18  	B[T]
    19  }
    20  
    21  func f[T any]() {
    22  	s := &A[T]{
    23  		&BImpl[T]{},
    24  	}
    25  	// golang.org/issue/48056
    26  	s.Work()
    27  }
    28  

View as plain text