mirror of
https://github.com/golang/go
synced 2024-11-23 22:40:04 -07:00
go/types, cmd/compile/internal/types2: minor adjustments (cleanups)
go/types: - gofmt a couple of files types2: - add loong64 to sizes list (present in go/types) - fix a type in validtype.go - co-locate an accessor with others in typeparam.go This changes further reduce discrepancy between types2 and go/types. Change-Id: I2e6a09f1c4b8dbc947c48af13031ff58a2bc6f4d Reviewed-on: https://go-review.googlesource.com/c/go/+/460996 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Run-TryBot: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
This commit is contained in:
parent
3c357409d1
commit
839c842550
@ -17,6 +17,7 @@ var gccgoArchSizes = map[string]*StdSizes{
|
|||||||
"arm64": {8, 8},
|
"arm64": {8, 8},
|
||||||
"arm64be": {8, 8},
|
"arm64be": {8, 8},
|
||||||
"ia64": {8, 8},
|
"ia64": {8, 8},
|
||||||
|
"loong64": {8, 8},
|
||||||
"m68k": {4, 2},
|
"m68k": {4, 2},
|
||||||
"mips": {4, 8},
|
"mips": {4, 8},
|
||||||
"mipsle": {4, 8},
|
"mipsle": {4, 8},
|
||||||
|
@ -24,9 +24,6 @@ type TypeParam struct {
|
|||||||
bound Type // any type, but underlying is eventually *Interface for correct programs (see TypeParam.iface)
|
bound Type // any type, but underlying is eventually *Interface for correct programs (see TypeParam.iface)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Obj returns the type name for the type parameter t.
|
|
||||||
func (t *TypeParam) Obj() *TypeName { return t.obj }
|
|
||||||
|
|
||||||
// NewTypeParam returns a new TypeParam. Type parameters may be set on a Named
|
// NewTypeParam returns a new TypeParam. Type parameters may be set on a Named
|
||||||
// or Signature type by calling SetTypeParams. Setting a type parameter on more
|
// or Signature type by calling SetTypeParams. Setting a type parameter on more
|
||||||
// than one type will result in a panic.
|
// than one type will result in a panic.
|
||||||
@ -59,6 +56,9 @@ func (check *Checker) newTypeParam(obj *TypeName, constraint Type) *TypeParam {
|
|||||||
return typ
|
return typ
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Obj returns the type name for the type parameter t.
|
||||||
|
func (t *TypeParam) Obj() *TypeName { return t.obj }
|
||||||
|
|
||||||
// Index returns the index of the type param within its param list, or -1 if
|
// Index returns the index of the type param within its param list, or -1 if
|
||||||
// the type parameter has not yet been bound to a type.
|
// the type parameter has not yet been bound to a type.
|
||||||
func (t *TypeParam) Index() int {
|
func (t *TypeParam) Index() int {
|
||||||
|
@ -198,7 +198,7 @@ func makeObjList(tlist []*Named) []Object {
|
|||||||
// nest = A[A[string]]->B[P]
|
// nest = A[A[string]]->B[P]
|
||||||
// path = A[A[string]]->B[P]
|
// path = A[A[string]]->B[P]
|
||||||
//
|
//
|
||||||
// Eventutally we reach the type parameter P of type B (P₂):
|
// Eventually we reach the type parameter P of type B (P₂):
|
||||||
//
|
//
|
||||||
// P₂
|
// P₂
|
||||||
// nest = A[A[string]]->B[P]
|
// nest = A[A[string]]->B[P]
|
||||||
|
1
src/go/types/testdata/manual.go
vendored
1
src/go/types/testdata/manual.go
vendored
@ -6,4 +6,3 @@
|
|||||||
// without source arguments. Use for one-off debugging.
|
// without source arguments. Use for one-off debugging.
|
||||||
|
|
||||||
package p
|
package p
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user