]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: report types for mismatched call and return statements
authorRobert Griesemer <gri@golang.org>
Thu, 25 Nov 2021 00:48:00 +0000 (16:48 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 29 Nov 2021 22:02:48 +0000 (22:02 +0000)
commit2f6d3820501b34ce530be8193789659c18db0867
tree3bb58e606facadb64b38e7380dac15aaff5277b5
parent1970e3e3b7b6c42676acc22071ced887ac68b520
go/types: report types for mismatched call and return statements

This is a port of CL 364874 from types2 to go/types with various
adjustments:

- the error position for "not enough arguments" in calls is the
  closing ) rather than the position of the last provided argument

- the ERROR comments in tests are positioned accordingly

- the reg. expression for matching error strings accepts newlines
  for the . pattern (added s flag)

For #48834.
For #48835.

Change-Id: I64362ecf605bcf9d89b8dc121432e0131bd5da1b
Reviewed-on: https://go-review.googlesource.com/c/go/+/367196
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/go/types/assignments.go
src/go/types/call.go
src/go/types/check_test.go
src/go/types/decl.go
src/go/types/stmt.go
src/go/types/testdata/check/errors.src
src/go/types/testdata/check/expr3.src
src/go/types/testdata/check/stmt0.src
src/go/types/testdata/check/vardecl.src