aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/script/scripttest
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2024-07-29 15:29:08 -0700
committerGopher Robot <gobot@golang.org>2024-07-30 23:42:46 +0000
commit86bec1ec198f2720c83bd232a72b800b4ea5a9f6 (patch)
treeddb0d2f353631dc477324a547317fb3aa743ff4f /src/cmd/internal/script/scripttest
parent7299212a425d6c4a2df93ec4633ba1e1b7a5b9be (diff)
downloadgo-86bec1ec198f2720c83bd232a72b800b4ea5a9f6.tar.xz
go/types: record pointer and parentheses in receiver expressions
CL 594740 rewrote type checking of method receiver types. Because that CL takes apart receivers "manually" rather than using the regular code for type checking type expressions, pointer and parenthesized receiver type expressions were not recorded anymore. Adjust the code that typechecks method receivers to a) use ordinary type expression checking for non-generic receivers, and b) to record a missing pointer and any intermediate parenthesized expressions in case of a generic receiver. Add many extra tests verifying that the correct types for parenthesized and pointer type expressions are recorded in various source positions. Note that the parser used by the compiler and types2 doesn't encode unnecessary parentheses in type expressions in its syntax tree. As a result, the tests that explicitly test parentheses don't work in types2 and are commented out. This CL adds code (disabled by default) to the parser to encode parentheses in type expressions in the syntax tree. When enabled, the commented out types2 tests pass like in go/types. Fixes #68639. For #51343. Change-Id: Icf3d6c76f7540ee53e229660be8d78bb25380539 Reviewed-on: https://go-review.googlesource.com/c/go/+/601657 Reviewed-by: Tim King <taking@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/internal/script/scripttest')
0 files changed, 0 insertions, 0 deletions