]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: consider methods when unifying type parameters and constraints
authorRobert Griesemer <gri@golang.org>
Tue, 28 Feb 2023 20:56:06 +0000 (12:56 -0800)
committerGopher Robot <gobot@golang.org>
Wed, 1 Mar 2023 21:23:52 +0000 (21:23 +0000)
commitb44f2222b5e3d9de0d214101bf458251ac30ffe3
treecd87f5c77792c57a2ce9312ca42cc2d870fd2b9f
parent09852e75acc8228887713e75e9c88dc864978065
go/types, types2: consider methods when unifying type parameters and constraints

An inferred type argument must implement its type parameter's constraint's
methods whether or not a core type exists. This allows us to infer type
parameters used in method signatures.

Fixes #51593.

Change-Id: I1fddb05a71d442641b4311d8e30a13ea9bdb4db5
Reviewed-on: https://go-review.googlesource.com/c/go/+/472298
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/check_test.go
src/cmd/compile/internal/types2/infer.go
src/go/types/infer.go
src/internal/types/testdata/examples/inference.go
src/internal/types/testdata/fixedbugs/issue51593.go