go.tools/go/types: adjust comments for godoc

R=adonovan
CC=golang-codereviews
https://golang.org/cl/38560045
This commit is contained in:
Robert Griesemer 2014-01-07 10:03:15 -08:00
parent 26542a8bc5
commit b6eef48120
3 changed files with 21 additions and 22 deletions

View File

@ -24,19 +24,19 @@ const (
// A Selection describes a selector expression x.f.
// For the declarations:
//
// type T struct{ x int; E }
// type E struct{}
// func (e E) m() {}
// var p *T
// type T struct{ x int; E }
// type E struct{}
// func (e E) m() {}
// var p *T
//
// the following relations exist:
//
// Selector Kind Recv Obj Type Index Indirect
//
// p.x FieldVal T x int {0} true
// p.m MethodVal *T m func (e *T) m() {1, 0} true
// T.m MethodExpr T m func m(_ T) {1, 0} false
// math.Pi PackageObj nil Pi untyped numeric nil false
// p.x FieldVal T x int {0} true
// p.m MethodVal *T m func (e *T) m() {1, 0} true
// T.m MethodExpr T m func m(_ T) {1, 0} false
// math.Pi PackageObj nil Pi untyped numeric nil false
//
type Selection struct {
kind SelectionKind

View File

@ -24,13 +24,13 @@ type Sizes interface {
// StdSizes is a convenience type for creating commonly used Sizes.
// It makes the following simplifying assumptions:
//
// - The size of explicitly sized basic types (int16, etc.) is the
// specified size.
// - The size of strings, functions, and interfaces is 2*WordSize.
// - The size of slices is 3*WordSize.
// - All other types have size WordSize.
// - Arrays and structs are aligned per spec definition; all other
// types are naturally aligned with a maximum alignment MaxAlign.
// - The size of explicitly sized basic types (int16, etc.) is the
// specified size.
// - The size of strings, functions, and interfaces is 2*WordSize.
// - The size of slices is 3*WordSize.
// - All other types have size WordSize.
// - Arrays and structs are aligned per spec definition; all other
// types are naturally aligned with a maximum alignment MaxAlign.
//
// *StdSizes implements Sizes.
//

View File

@ -14,18 +14,17 @@ import (
// If GcCompatibilityMode is set, printing of types is modified
// to match the representation of some types in the gc compiler:
//
// - byte and rune lose their alias name and simply stand for
// uint8 and int32 respectively
//
// - embedded interfaces get flattened (the embedding info is lost,
// and certain recursive interface types cannot be printed anymore)
// - byte and rune lose their alias name and simply stand for
// uint8 and int32 respectively
// - embedded interfaces get flattened (the embedding info is lost,
// and certain recursive interface types cannot be printed anymore)
//
// This makes it easier to compare packages computed with the type-
// checker vs packages imported from gc export data.
//
// Caution: This flag affects all uses of WriteType, globally.
// It is only provided for testing in conjunction with
// gc-generated data. It may be removed at any time.
// It is only provided for testing in conjunction with
// gc-generated data. It may be removed at any time.
var GcCompatibilityMode bool
// TypeString returns the string representation of typ.