Fixes #43285.
Change-Id: Iddadf76e2dc10fcf77f588c865a68125ebeda290
Reviewed-on: https://go-review.googlesource.com/c/go/+/623756
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
goto Error
}
case builtin:
- check.errorf(e.Pos(), UncalledBuiltin, "cannot select on %s", x)
+ check.errorf(e.Pos(), UncalledBuiltin, "invalid use of %s in selector expression", x)
goto Error
case invalid:
goto Error
}
case builtin:
// types2 uses the position of '.' for the error
- check.errorf(e.Sel, UncalledBuiltin, "cannot select on %s", x)
+ check.errorf(e.Sel, UncalledBuiltin, "invalid use of %s in selector expression", x)
goto Error
case invalid:
goto Error
package p
func _() {
- len.Println /* ERROR "cannot select on len" */
- len.Println /* ERROR "cannot select on len" */ ()
- _ = len.Println /* ERROR "cannot select on len" */
+ len.Println /* ERROR "invalid use of len (built-in) in selector expression" */
+ len.Println /* ERROR "invalid use of len (built-in) in selector expression" */ ()
+ _ = len.Println /* ERROR "invalid use of len (built-in) in selector expression" */
_ = len /* ERROR "cannot index len" */ [0]
_ = *len /* ERROR "cannot indirect len" */
}