github.com/JimmyHuang454/JLS-go@v0.0.0-20230831150107-90d536585ba0/internal/types/testdata/fixedbugs/issue50833.go (about)

     1  // Copyright 2022 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package p
     6  
     7  type (
     8  	S  struct{ f int }
     9  	PS *S
    10  )
    11  
    12  func a() []*S { return []*S{{f: 1}} }
    13  func b() []PS { return []PS{{f: 1}} }
    14  
    15  func c[P *S]() []P { return []P{{f: 1}} }
    16  func d[P PS]() []P { return []P{{f: 1}} }