]> Cypherpunks repositories - gostls13.git/commitdiff
go/types, cmd/compile/internal/types2: minor adjustments (cleanups)
authorRobert Griesemer <gri@golang.org>
Mon, 9 Jan 2023 19:46:15 +0000 (11:46 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 17 Jan 2023 19:55:06 +0000 (19:55 +0000)
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>
src/cmd/compile/internal/types2/gccgosizes.go
src/cmd/compile/internal/types2/typeparam.go
src/cmd/compile/internal/types2/validtype.go
src/go/types/errorcalls_test.go
src/go/types/testdata/manual.go

index 05aba5347291b34c8154476d55c6cd8852d5106c..460200126c386ddbd31142a640023ebfaf24d1b9 100644 (file)
@@ -17,6 +17,7 @@ var gccgoArchSizes = map[string]*StdSizes{
        "arm64":       {8, 8},
        "arm64be":     {8, 8},
        "ia64":        {8, 8},
+       "loong64":     {8, 8},
        "m68k":        {4, 2},
        "mips":        {4, 8},
        "mipsle":      {4, 8},
index 2e9a2adae672c1c46d489dc42b0d069fdd2291ab..aebbec27a8b7e3b54f56ab93f8c9c20f7af81b8d 100644 (file)
@@ -24,9 +24,6 @@ type TypeParam struct {
        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
 // or Signature type by calling SetTypeParams. Setting a type parameter on more
 // than one type will result in a panic.
@@ -59,6 +56,9 @@ func (check *Checker) newTypeParam(obj *TypeName, constraint Type) *TypeParam {
        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
 // the type parameter has not yet been bound to a type.
 func (t *TypeParam) Index() int {
index b0ebc025608cc82285b1e7a39772e51ebbfa597e..dbe91dc08f30d3f6113814613091d3ab4371dc36 100644 (file)
@@ -198,7 +198,7 @@ func makeObjList(tlist []*Named) []Object {
 //         nest = 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₂
 //         nest = A[A[string]]->B[P]
index ea9a122063cf8b0d24b6b7474a07f87d838258e9..d76c06da3008fb6857db00afa5844c7c7664dfd1 100644 (file)
@@ -94,4 +94,4 @@ func balancedParentheses(s string) bool {
                stack = stack[:top]
        }
        return len(stack) == 0
-}
\ No newline at end of file
+}
index a7caee99032d3b3f95a077bccf1cacbdd54bc8a4..96d4ba67c225ffc0eea310a70f8c98edb6304f74 100644 (file)
@@ -6,4 +6,3 @@
 // without source arguments. Use for one-off debugging.
 
 package p
-