...

Source file src/internal/types/testdata/fixedbugs/issue45639.go

Documentation: internal/types/testdata/fixedbugs

     1  // Copyright 2021 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  // For now, a lone type parameter is not permitted as RHS in a type declaration (issue #45639).
     8  // // It is not permitted to declare a local type whose underlying
     9  // // type is a type parameters not declared by that type declaration.
    10  // func _[T any]() {
    11  // 	type _ T         // ERROR "cannot use function type parameter T as RHS in type declaration"
    12  // 	type _ [_ any] T // ERROR "cannot use function type parameter T as RHS in type declaration"
    13  // }
    14  

View as plain text