github.com/JimmyHuang454/JLS-go@v0.0.0-20230831150107-90d536585ba0/internal/types/testdata/fixedbugs/issue51339.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  // This file is tested when running "go test -run Manual"
     6  // without source arguments. Use for one-off debugging.
     7  
     8  package p
     9  
    10  type T[P any, B *P] struct{}
    11  
    12  func (T /* ERROR cannot use generic type */ ) m0() {}
    13  
    14  // TODO(rfindley): eliminate the duplicate errors here.
    15  func (/* ERROR got 1 type parameter, but receiver base type declares 2 */ T /* ERROR got 1 arguments but 2 type parameters */ [_]) m1() {}
    16  func (T[_, _]) m2() {}
    17  // TODO(gri) this error is unfortunate (issue #51343)
    18  func (T /* ERROR got 3 arguments but 2 type parameters */ [_, _, _]) m3() {}