]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: further simplify unification
authorRobert Griesemer <gri@golang.org>
Mon, 30 Jan 2023 19:09:48 +0000 (11:09 -0800)
committerGopher Robot <gobot@golang.org>
Wed, 1 Feb 2023 21:30:34 +0000 (21:30 +0000)
commitbd749504b825677ecc0b8c0f4df785f074719051
treea50f42abf890522863899fba57ce95947b51861b
parent4b7f7eef3fc09f7a595378179ed867f52daea55f
go/types, types2: further simplify unification

Allocate all handles up-front: in a correct program, all type parameters
must be resolved and thus eventually will get a handle.
Also, sharing of handles caused by unified type parameters is rare and
so it's ok to not optimize for that case (and delay handle allocation).

This removes a (premature) optimization whis further simplifies
unification.

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