1
0
mirror of https://github.com/golang/go synced 2024-11-22 03:04:41 -07:00

go/doc: test case for corner case (override of predecl. type)

R=rsc
CC=golang-dev
https://golang.org/cl/5575055
This commit is contained in:
Robert Griesemer 2012-01-25 09:54:10 -08:00
parent 6d68be46dd
commit 57af5429e6
3 changed files with 41 additions and 0 deletions

View File

@ -24,6 +24,12 @@ FUNCTIONS
//
func F(x int) int
// Always under the package functions list.
func NotAFactory() int
// Associated with uint type if AllDecls is set.
func UintFactory() uint
TYPES
//
@ -32,3 +38,6 @@ TYPES
//
var V T // v
//
func (x *T) M()

View File

@ -24,6 +24,9 @@ FUNCTIONS
//
func F(x int) int
// Always under the package functions list.
func NotAFactory() int
TYPES
//
@ -32,3 +35,15 @@ TYPES
//
var V T // v
//
func (x *T) M()
// Should only appear if AllDecls is set.
type uint struct{}
// Associated with uint type if AllDecls is set.
func UintFactory() uint
// Associated with uint type if AllDecls is set.
func uintFactory() uint

View File

@ -6,8 +6,25 @@ package b
import "a"
// Basic declarations
const Pi = 3.14 // Pi
var MaxInt int // MaxInt
type T struct{} // T
var V T // v
func F(x int) int {} // F
func (x *T) M() {} // M
// Corner cases: association with (presumed) predeclared types
// Always under the package functions list.
func NotAFactory() int {}
// Associated with uint type if AllDecls is set.
func UintFactory() uint {}
// Associated with uint type if AllDecls is set.
func uintFactory() uint {}
// Should only appear if AllDecls is set.
type uint struct{} // overrides a predeclared type uint