]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: adjust Checker.recordCommaOkTypes signature
authorRobert Griesemer <gri@golang.org>
Wed, 22 Mar 2023 00:21:17 +0000 (17:21 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 24 Mar 2023 19:13:38 +0000 (19:13 +0000)
commitbd7b19356f3827c36ef584bfd8e88aa6cee00710
treea67bc27bc0a2f5abd1a6ea138c6991de73c3f9b3
parent0ed364a46379f9561b72a29e7fdad15a1e191325
go/types, types2: adjust Checker.recordCommaOkTypes signature

By changing the signature to accept a slice rather than an
array, we can avoid creating the array in the first place.

Functionally, we now also record comma-ok types if the
corresponding assignment was incorrect. But this change
provides more (not less) information through the API and
only so if the program is incorrect in the first place.

Change-Id: I0d629441f2f890a37912171fb26ef0e75827ce23
Reviewed-on: https://go-review.googlesource.com/c/go/+/478218
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/types2/assignments.go
src/cmd/compile/internal/types2/check.go
src/go/types/assignments.go
src/go/types/check.go