]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: simplify symmetric code
authorRobert Griesemer <gri@golang.org>
Thu, 2 Feb 2023 18:14:58 +0000 (10:14 -0800)
committerGopher Robot <gobot@golang.org>
Thu, 2 Feb 2023 23:39:53 +0000 (23:39 +0000)
commit331f0c69769fb856f00c75f29085665f60a7af7b
tree4d2252c675959fc9bdf1cb3d5351334e9d5c4ca8
parent3313880bdcb29d24dc5068b3a0f1bdd102c12b13
go/types, types2: simplify symmetric code

Because unification is symmetric, in cases where we have symmetric
code for x and y depending on some property we can swap x and y as
needed and simplify the code.

Also, change u.depth increment/decrement position for slightly
nicer tracing ooutput.

Change-Id: I2e84570d463d1c32f6556108f3cb54062b57c718
Reviewed-on: https://go-review.googlesource.com/c/go/+/464896
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/unify.go
src/go/types/unify.go