]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/typecheck: remove base.Errorf from Assignop
authorMichael Pratt <mpratt@google.com>
Mon, 15 May 2023 17:42:13 +0000 (13:42 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 22 May 2023 15:07:01 +0000 (15:07 +0000)
commit374bd6a3ac7a201cfb37230942fedaa0451e4de6
treeb29a6fca6bb69ffc91fa5ee3a886adddc63bf36a
parent4859392cc29a35a0126e249ecdedbd022c755b20
cmd/compile/internal/typecheck: remove base.Errorf from Assignop

The documentation for Assignop specifies that if the assignment is not
valid, the reason for the failure is returned via a reason string
without failing the build.

A few cases in Assignop1 -> implements -> ifacelookdot directly call
base.Errorf rather than plumbing through the reason string as they
should. Drop these calls. Since error messages are mostly unreachable
here (it only applies to generated code), don't maintain them and allow
them to just fallthrough to the generic "missing method" message.

This is important for PGO specialization, which opportunistically checks
if candidate interface call targets implement the interface. Many of
these will fail, which should not break the build.

For #59959.

Change-Id: I1891ca0ebebc1c1f51a0d0285035bbe8753036bc
Reviewed-on: https://go-review.googlesource.com/c/go/+/494959
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
src/cmd/compile/internal/typecheck/subr.go