From: Cuong Manh Le Date: Thu, 17 Sep 2020 00:46:01 +0000 (+0700) Subject: cmd/compile: rename retsigerr to sigerr X-Git-Tag: go1.16beta1~1002 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4ffc2bc533ed39b3cbb343ad5873105bfd58ff10;p=gostls13.git cmd/compile: rename retsigerr to sigerr retsigerr was used to create error message for both wrong function arguments and return arguments, so change its name to sigerr to reflect that. While at it, also add documentation for the wrong function arguments case. Passes toolstash-check. Change-Id: I740c717ad38d4afab9e8c20f2e94579c8bca67ff Reviewed-on: https://go-review.googlesource.com/c/go/+/255240 Trust: Cuong Manh Le Run-TryBot: Cuong Manh Le TryBot-Result: Go Bot Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go index faa13d72f9..cbfaa3073e 100644 --- a/src/cmd/compile/internal/gc/typecheck.go +++ b/src/cmd/compile/internal/gc/typecheck.go @@ -2711,7 +2711,7 @@ func errorDetails(nl Nodes, tstruct *types.Type, isddd bool) string { return "" } } - return fmt.Sprintf("\n\thave %s\n\twant %v", nl.retsigerr(isddd), tstruct) + return fmt.Sprintf("\n\thave %s\n\twant %v", nl.sigerr(isddd), tstruct) } // sigrepr is a type's representation to the outside world, @@ -2735,9 +2735,8 @@ func sigrepr(t *types.Type) string { return t.String() } -// retsigerr returns the signature of the types -// at the respective return call site of a function. -func (nl Nodes) retsigerr(isddd bool) string { +// sigerr returns the signature of the types at the call or return. +func (nl Nodes) sigerr(isddd bool) string { if nl.Len() < 1 { return "()" }