X7ROOT File Manager
Current Path:
/opt/golang/1.19.4/src/cmd/compile/internal/syntax/testdata
opt
/
golang
/
1.19.4
/
src
/
cmd
/
compile
/
internal
/
syntax
/
testdata
/
📁
..
📄
chans.go
(1.82 KB)
📄
fallthrough.go
(946 B)
📄
interface.go
(1.07 KB)
📄
issue20789.go
(355 B)
📄
issue23385.go
(406 B)
📄
issue23434.go
(634 B)
📄
issue31092.go
(522 B)
📄
issue43527.go
(1.09 KB)
📄
issue43674.go
(452 B)
📄
issue46558.go
(308 B)
📄
issue47704.go
(384 B)
📄
issue48382.go
(736 B)
📄
issue49205.go
(932 B)
📄
issue49482.go
(965 B)
📄
issue52391.go
(400 B)
📄
linalg.go
(2.07 KB)
📄
map.go
(2.76 KB)
📄
map2.go
(3.39 KB)
📄
sample.go
(951 B)
📄
slices.go
(1.49 KB)
📄
smoketest.go
(1.16 KB)
📄
tparams.go
(1.01 KB)
📄
typeset.go
(2.32 KB)
Editing: smoketest.go
// Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains basic generic code snippets. package p // type parameter lists type B[P any] struct{} type _[P interface{}] struct{} type _[P B] struct{} type _[P B[P]] struct{} type _[A, B, C any] struct{} type _[A, B, C B] struct{} type _[A, B, C B[A, B, C]] struct{} type _[A1, A2 B1, A3 B2, A4, A5, A6 B3] struct{} type _[A interface{}] struct{} type _[A, B interface{ m() }] struct{} type _[A, B, C any] struct{} // in functions func _[P any]() func _[P interface{}]() func _[P B]() func _[P B[P]]() // type instantiations type _ T[int] // in expressions var _ = T[int]{} // in embedded types type _ struct{ T[int] } // interfaces type _ interface { m() ~int } type _ interface { ~int | ~float | ~string ~complex128 underlying(underlying underlying) underlying } type _ interface { T T[int] } // tricky cases func _(T[P], T[P1, P2]) func _(a [N]T) type _ struct { T[P] T[P1, P2] f[N] } type _ interface { m() // instantiated types T[ /* ERROR empty type argument list */ ] T[P] T[P1, P2] }
Upload File
Create Folder