]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: do not abort constraint type inference eagerly
authorRobert Griesemer <gri@golang.org>
Thu, 1 Dec 2022 22:29:11 +0000 (14:29 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 17 Jan 2023 19:54:58 +0000 (19:54 +0000)
commitcf5dbd44591ca885fe8deb14c1500447c915e6b8
tree4c95701c0ff748c66f91a782d0f0f4eed5c5a680
parent5cd805c6df5c8988ea07e2ec1e4c52574b40bbf1
go/types, types2: do not abort constraint type inference eagerly

During constraint type inference, unification may fail because it
operates with limited information (core types) even if the actual
type argument satisfies the type constraint in question.

On the other hand, it is safe to ignore failing unification during
constraint type inference because if the failure is true, an error
will be reported when checking instantiation.

Fixes #53650.

Change-Id: Ia76b21ff779bfb1282c1c55f4174847b29cc6f3a
Reviewed-on: https://go-review.googlesource.com/c/go/+/454655
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>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/types2/infer.go
src/go/types/infer.go
src/internal/types/testdata/fixedbugs/issue45985.go
src/internal/types/testdata/fixedbugs/issue53650.go [new file with mode: 0644]