Fixes #38745
Change-Id: I2fbd8b512a8cf911b81a087162c74416116efea5
Reviewed-on: https://go-review.googlesource.com/c/go/+/253678
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
return
notenough:
- if n == nil || !n.Diag() {
+ if n == nil || (!n.Diag() && n.Type != nil) {
details := errorDetails(nl, tstruct, isddd)
if call != nil {
// call is the expression being called, not the overall call.
_ = sum(tuple())
_ = sum(tuple()...) // ERROR "multiple-value"
_ = sum3(tuple())
- _ = sum3(tuple()...) // ERROR "multiple-value" "not enough"
+ _ = sum3(tuple()...) // ERROR "multiple-value"
)
type T []T
}
func f2() (*t, error) {
- // BAD: should report undefined error only.
- return t{}.M() // ERROR "t{}.M undefined \(type t has no field or method M\)" "not enough arguments to return"
+ return t{}.M() // ERROR "t{}.M undefined \(type t has no field or method M\)"
}