]> Cypherpunks repositories - gostls13.git/commitdiff
go/doc: test case for corner case (override of predecl. type)
authorRobert Griesemer <gri@golang.org>
Wed, 25 Jan 2012 17:54:10 +0000 (09:54 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 25 Jan 2012 17:54:10 +0000 (09:54 -0800)
R=rsc
CC=golang-dev
https://golang.org/cl/5575055

src/pkg/go/doc/testdata/b.0.golden
src/pkg/go/doc/testdata/b.1.golden
src/pkg/go/doc/testdata/b.go

index c5ad0d0fc83e71565cef62f0c0489734486c363b..7c33300616d2b87549e6c86a431c3d61a035a8ba 100644 (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()
+
index c5ad0d0fc83e71565cef62f0c0489734486c363b..f30380516bda5bed1153b662377afc5ca7b7a1e1 100644 (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
+
index cdc77ef784c6ee68fb747a7938c2ab42df0705f5..28660f9be7c73ac095f6c532819b984e41ebe0f5 100644 (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