1. 27 1月, 2022 1 次提交
  2. 26 1月, 2022 5 次提交
    • B
      cmd/go: add mv and support "! cmp" in script tests · 827babf6
      Bryan C. Mills 提交于
      For #50183
      
      Change-Id: Ie384333fb7a69d0d2cfaba0cfc4eb7afba2fd745
      Reviewed-on: https://go-review.googlesource.com/c/go/+/380916
      Trust: Bryan Mills <bcmills@google.com>
      Run-TryBot: Bryan Mills <bcmills@google.com>
      TryBot-Result: Gopher Robot <gobot@golang.org>
      Reviewed-by: NRuss Cox <rsc@golang.org>
      827babf6
    • R
      all: update vendored golang.org/x/tools · 6eb58cdf
      Robert Findley 提交于
      Update the vendored x/tools to pick up CL 380014, which updates the
      ifaceassert vet analyzer to remove spurious errors for assertions
      involving interfaces with type parameters.
      
      This also picks up some superficial changes related to refactoring of
      the x/tools/internal/typeparams API.
      
      The following commands were used:
      
        go get -d golang.org/x/tools@master
        go mod tidy
        go mod vendor
      
      Fixes #50658
      
      Change-Id: I2f612fd186a1a260cab21860b192c9f6dc3f560f
      Reviewed-on: https://go-review.googlesource.com/c/go/+/380777
      Trust: Robert Findley <rfindley@google.com>
      Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
      Reviewed-by: NDmitri Shuralyov <dmitshur@golang.org>
      TryBot-Result: Gopher Robot <gobot@golang.org>
      Reviewed-by: NTim King <taking@google.com>
      6eb58cdf
    • R
      go/types, types2: all interfaces implement comparable (add tests) · 38729cff
      Robert Griesemer 提交于
      For #50646.
      
      Change-Id: I7420545556e0df2659836364a62ce2c32ad7a8b1
      Reviewed-on: https://go-review.googlesource.com/c/go/+/380654
      Trust: Robert Griesemer <gri@golang.org>
      Reviewed-by: NRobert Findley <rfindley@google.com>
      38729cff
    • R
      go/types, types2: make each method instantiation independently lazy · b66bc0a9
      Robert Findley 提交于
      Method signatures can introduce a significant number of edges into the
      type graph. One can imagine a generic type with many methods, each of
      which may use other instantiated types, etc. For performance, when type
      checking generic code, we should avoid unnecessary instantiation of
      methods wherever possible.
      
      This CL achieves this by making method instantiation lazy at the
      individual method level. It abstracts method access into a methodList
      type, which may be either eager or lazy. In the lazy case, methods are
      only instantiated when they are accessed via the Named.Method,
      MethodSet, or LookupFieldOrMethod APIs. Factoring out a methodList type
      makes it easier to verify that we're not leaking the methods slice
      anywhere, and as a side benefit reduces the size of *Named types in the
      case where there are no methods. The effective memory footprint of Named
      types with methods increases by a pointer (to hold the slice of guards),
      and the footprint of instantiated named types increases additionally by
      a sync.Once per method. We estimate that this memory increase is more
      than offset by the reduction in the number of instantiated methods.
      
      This also simplifies the code. Previously we had to work around the fact
      that named type expansion could occur before all signatures were set-up,
      by stashing the instantiated receiver into a partially filled-out *Func.
      With fully lazy methods, we can rely on the invariant that any use of
      methods in valid code can only occur after all signatures can be type
      checked. This means that we can fully instantiate the *Func, and don't
      need to deal with partially instantiated stubs.
      
      Finally, this CL fixes a bug (issue #50619), where traversing
      Method->Receiver Type->Method did not get us back where we started. This
      is fixed by not instantiating a new method if t is already the receiver
      base of the original method.
      
      A test is added to explicitly verify the invariant above, and more test
      cases are added for the behavior of Info with respect to generic code.
      
      Fixes #50619
      
      Change-Id: I5b6d2bdc4404c9f5dcb583a29cb64e8af9794c54
      Reviewed-on: https://go-review.googlesource.com/c/go/+/380499
      Trust: Robert Findley <rfindley@google.com>
      Run-TryBot: Robert Findley <rfindley@google.com>
      Reviewed-by: NRobert Griesemer <gri@golang.org>
      TryBot-Result: Gopher Robot <gobot@golang.org>
      b66bc0a9
    • D
      test: add a new test absdiff3.go which uses function callback · 078ddecc
      Dan Scales 提交于
      We have disallowed having a typeparam on the right-hand-side of a type
      declaration. So, we disabled much of the test absdiff.go. I recently
      wrote a new test absdiff2.go to use a structure containing the type
      param type, so I could attach a method properly and run the full test.
      
      As a contrast, I thought I would create absdiff3.go, where the Abs
      functionality is passed in as a function callback (but derived from a
      generic function). This is simpler, and more inline with some of the
      guidelines that Ian has been proposing (use passed-in functions rather
      than requiring methods, when possible, for greater ease-of-use).
      
      Only adds a new test absdiff3.go. (And fixes a comment in absdiff2.go.)
      
      Change-Id: I6dd185b50a3baeec31f689a892319963468a7201
      Reviewed-on: https://go-review.googlesource.com/c/go/+/380774Reviewed-by: NRobert Griesemer <gri@golang.org>
      Trust: Dan Scales <danscales@google.com>
      078ddecc
  3. 25 1月, 2022 16 次提交
  4. 24 1月, 2022 2 次提交
  5. 22 1月, 2022 3 次提交
  6. 21 1月, 2022 5 次提交
  7. 20 1月, 2022 8 次提交