]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: factor out single commonUnder function
authorRobert Griesemer <gri@golang.org>
Mon, 3 Mar 2025 23:11:47 +0000 (15:11 -0800)
committerGopher Robot <gobot@golang.org>
Thu, 6 Mar 2025 21:35:46 +0000 (13:35 -0800)
commit8b7e376e71cbd23a0644ff50cc4e75ce47cd9723
treebea412f5fd7813355c1b0504f7f4b1bc0b5e98d2
parentf55bb135d28bc95131a8c987d50350e5c6d7f633
go/types, types2: factor out single commonUnder function

Combine commonUnder and commonUnderOrChan:
- Provide an optional cond(ition) function argument to commonUnder
  to establish additional type set conditions.
- Instead of a *Checker and *string argument for error reporting,
  return an error cause that is only allocated in the presence of
  an error.
- Streamline some error messages.

Replace all calls to coreType with calls to commonUnder.

Change-Id: I81ac86d0d532cddc09164309acced61d90718b44
Reviewed-on: https://go-review.googlesource.com/c/go/+/654455
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
23 files changed:
src/cmd/compile/internal/types2/builtins.go
src/cmd/compile/internal/types2/call.go
src/cmd/compile/internal/types2/compilersupport.go
src/cmd/compile/internal/types2/expr.go
src/cmd/compile/internal/types2/infer.go
src/cmd/compile/internal/types2/literals.go
src/cmd/compile/internal/types2/lookup.go
src/cmd/compile/internal/types2/predicates.go
src/cmd/compile/internal/types2/stmt.go
src/cmd/compile/internal/types2/under.go
src/cmd/compile/internal/types2/unify.go
src/go/types/builtins.go
src/go/types/call.go
src/go/types/expr.go
src/go/types/infer.go
src/go/types/literals.go
src/go/types/lookup.go
src/go/types/predicates.go
src/go/types/stmt.go
src/go/types/under.go
src/go/types/unify.go
src/internal/types/testdata/fixedbugs/issue43671.go
src/internal/types/testdata/fixedbugs/issue47115.go