Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
tparam1.go44 linesDownload Raw Back to typeparam
1// errorcheck2 3// Copyright 2020 The Go Authors. All rights reserved.4// Use of this source code is governed by a BSD-style5// license that can be found in the LICENSE file.6 7// Basic type parameter list type-checking (not syntax) errors.8 9package tparam110 11// The predeclared identifier "any" may be used in place of interface{}.12var _ any13 14func _(_ any)15 16type _[_ any] struct{}17 18const N = 1019 20type (21	_                     []struct{}  // slice22	_                     [N]struct{} // array23	_[T any]              struct{}24	_[T, T any]           struct{} // ERROR "T redeclared"25	_[T1, T2 any, T3 any] struct{}26)27 28func _[T any]()             {}29func _[T, T any]()          {} // ERROR "T redeclared"30func _[T1, T2 any](x T1) T2 { panic(0) }31 32// Type parameters are visible from opening [ to end of function.33type C interface{}34 35func _[T interface{}]()        {}36func _[T C]()                  {}37func _[T struct{}]()           {} // ok if #48424 is accepted38func _[T interface{ m() T }]() {}39func _[T1 interface{ m() T2 }, T2 interface{ m() T1 }]() {40	var _ T141}42 43// TODO(gri) expand this44 
codekingpro/portable-devtools · Team Ai