]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: use inexact unification when unifying against core types
authorRobert Griesemer <gri@golang.org>
Tue, 6 Jun 2023 21:30:31 +0000 (14:30 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 12 Jun 2023 16:27:51 +0000 (16:27 +0000)
commitf35d2dae74d12b06df061d909cb9721f27208a15
treea39b88456b45cc370238c696e1d180349f5003a5
parent0fcc70ecd56e3b5c214ddaee4065ea1139ae16b5
go/types, types2: use inexact unification when unifying against core types

Follow-up on CL 498955 which introduced a unification mode, to be used
to control the precision of unification of element types (CL 498895):
When unifying against core types of unbound type parameters, we must
use inexact unification at the top (irrespective of the unification mode),
otherwise it may fail when unifying against a defined type (core types
are always underlying types).

No specific test case (I have not been able to create one yet).

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