]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: deal with comparable embedded in a constraint
authorDan Scales <danscales@google.com>
Mon, 15 Mar 2021 17:27:06 +0000 (10:27 -0700)
committerDan Scales <danscales@google.com>
Tue, 16 Mar 2021 18:42:06 +0000 (18:42 +0000)
commit832a01aad409dc0e41eabb53bfdb64d1a41b2c83
tree4540978653a50809c849b650db5f681fef998deb
parente31e84010e0989e1df4bd2c55d529497119bb345
cmd/compile:  deal with comparable embedded in a constraint

Ignore an embedded type in an interface which is the predeclared
interface "comparable" (which currently can only be in a type
constraint), since the name doesn't resolve and the "comparable" type
doesn't have any relevant methods (for the purposes of the compiler).

Added new test case graph.go that needs this fix.

Change-Id: I2443d2c3dfeb9d0a78aaaaf91a2808ae2759d247
Reviewed-on: https://go-review.googlesource.com/c/go/+/301831
Trust: Dan Scales <danscales@google.com>
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/noder/types.go
src/cmd/compile/internal/types2/type.go
test/typeparam/graph.go [new file with mode: 0644]