Source file test/typeparam/issue55101.go

     1  // compile
     2  
     3  // Copyright 2022 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  func F() *Cache[error] { return nil }
    10  
    11  type Cache[T any] struct{ l *List[entry[T]] }
    12  type entry[T any] struct{ value T }
    13  type List[T any] struct{ len int }
    14  
    15  func (c *Cache[V]) Len() int { return c.l.Len() }
    16  func (l *List[T]) Len() int  { return l.len }
    17  

View as plain text