Commit 589e32db authored by Robert Griesemer's avatar Robert Griesemer
Browse files

[dev.typeparams] cmd/compile/internal/types2: replace Sum type with Union type

- We still mostly ignore the tilde information.

- More consistent naming: A Union term is the pair (type, tilde).
  Rename Union.terms to Union.types; the Union.types and Union.tilde
  slices make up the Union terms.

- Replace Sum.is with Union.underIs: underIs iterates through all
  union terms and calls its argument function with the underlying
  type of the term (and thus can ignore the tilde information).
  This also eliminates the need to call under in the argument
  function.

- Added Union.is for situations where we need to consider the tilde
  information for each Union term.

Change-Id: I70fcf1813e072651dc0f61d52d5555642ee762fd
Reviewed-on: https://go-review.googlesource.com/c/go/+/323274


Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: default avatarRobert Findley <rfindley@google.com>
parent 7b876def
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment