This CL extends types2 with package height information, styled after
the way it works already in cmd/compile:
- A new NewPackageHeight entry point for constructing packages with
explicit height information, and a corresponding Height accessor
method.
- The types2 importer is updated to provide package height for
imported packages.
- The types2 type checker sets height based on imported packages.
- Adds an assertion to irgen to verify that types1 and types2
calculated the same height for the source package.
- Func.less's ordering incorporates package height to match
types.Sym.less and is generalized to object.less.
- sortTypes (used for sorting embedded types) now sorts defined types
using object.less as well.
Change-Id: Id4dbbb627aef405cc7438d611cbdd5a5bd97fc96
Reviewed-on: https://go-review.googlesource.com/c/go/+/321231
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>