]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/types2: check non-generic conversions first
authorRobert Griesemer <gri@golang.org>
Thu, 4 Nov 2021 03:42:44 +0000 (20:42 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 4 Nov 2021 16:36:19 +0000 (16:36 +0000)
commitf934b8326f18c4be2cb26ed1e87621d926ba209b
treef77013f0d5a6eefda7972afa8deec24f94067f77
parent6ba68a0581d537edfd6eb2e5675c408f18eb4eed
cmd/compile/internal/types2: check non-generic conversions first

This enables the elimination of convertibleToImpl again,
with the code structure close to the original non-generic
version, and closely matching the structure of assignableTo.

We also don't need the hasTerm tests; instead we can rely
directly on the mechanism of TypeParam.is which is feeding
a nil term if there are no specific types.

Change-Id: I0385acca779d75c3c961d06afb464714fe51705d
Reviewed-on: https://go-review.googlesource.com/c/go/+/361269
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/conversions.go