diff options
Diffstat (limited to 'test/typeparam')
| -rw-r--r-- | test/typeparam/gencrawler.dir/a.go | 27 | ||||
| -rw-r--r-- | test/typeparam/gencrawler.dir/main.go | 12 | ||||
| -rw-r--r-- | test/typeparam/gencrawler.go | 10 | ||||
| -rw-r--r-- | test/typeparam/gencrawler.out | 2 |
4 files changed, 51 insertions, 0 deletions
diff --git a/test/typeparam/gencrawler.dir/a.go b/test/typeparam/gencrawler.dir/a.go new file mode 100644 index 0000000000..50d6b4adeb --- /dev/null +++ b/test/typeparam/gencrawler.dir/a.go @@ -0,0 +1,27 @@ +// Copyright 2021 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. + +package a + +var V val[int] + +type val[T any] struct { + valx T +} + +func (v *val[T]) Print() { + v.print1() +} + +func (v *val[T]) print1() { + println(v.valx) +} + +func (v *val[T]) fnprint1() { + println(v.valx) +} + +func FnPrint[T any](v *val[T]) { + v.fnprint1() +} diff --git a/test/typeparam/gencrawler.dir/main.go b/test/typeparam/gencrawler.dir/main.go new file mode 100644 index 0000000000..063de7f350 --- /dev/null +++ b/test/typeparam/gencrawler.dir/main.go @@ -0,0 +1,12 @@ +// Copyright 2021 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. + +package main + +import "a" + +func main() { + a.V.Print() + a.FnPrint(&a.V) +} diff --git a/test/typeparam/gencrawler.go b/test/typeparam/gencrawler.go new file mode 100644 index 0000000000..7c268aed51 --- /dev/null +++ b/test/typeparam/gencrawler.go @@ -0,0 +1,10 @@ +// rundir -G=3 + +// Copyright 2021 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. + +// Testing that all methods of a private generic type are exported, if a variable +// with that type is exported. + +package ignored diff --git a/test/typeparam/gencrawler.out b/test/typeparam/gencrawler.out new file mode 100644 index 0000000000..aa47d0d46d --- /dev/null +++ b/test/typeparam/gencrawler.out @@ -0,0 +1,2 @@ +0 +0 |
