Source file src/internal/types/testdata/spec/receivers.go

     1  // Copyright 2024 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 receivers
     6  
     7  // TODO(gri) add more tests checking the various restrictions on receivers
     8  
     9  type G[P any] struct{}
    10  type A[P any] = G[P]
    11  
    12  func (a A /* ERROR "cannot define new methods on generic alias type A[P any]" */ [P]) m() {}
    13  

View as plain text