-
-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support GOEXPERIMENT=rangefunc #1494
Comments
cc'ed @dominikh on go.dev/cl/555075. |
I don't think Staticcheck will support ranging over functions until the feature is no longer experimental. I'd like to wait for the semantics to be finalized first. |
I believe it's worth noticing that the lack of support for |
Just a note that rangefunc is no longer experimental. It's now part of the main branch of Go development, though not yet released. |
This change disables analyzers that cannot yet safely process go1.23 range-over-func statements, including buildssa and buildir. (This is done by poking in an additional Analyzer.Requires edge on a new temporary analyzer that fails when it sees a range-over-func.) We plan to revert this change when ssa and ir support the new feature, but this CL will unblock uses of it in the standard library which would otherwise cause gopls' tests to crash. Updates golang/go#67237 Updates dominikh/go-tools#1494 Change-Id: Ibed2a88da94fb84234b4410b6bc7562a493287ce Reviewed-on: https://go-review.googlesource.com/c/tools/+/583778 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Findley <rfindley@google.com> Auto-Submit: Alan Donovan <adonovan@google.com>
Until staticcheck supports range-over-func, gopls won't attempt to run it on packages that use range-over-func, which is about to be nearly all packages. Our existing tests will not work. So, disable them for now. Updates dominikh/go-tools#1494 Updates golang/go#67262 Change-Id: Ia498b6122cbb7d3797d5d552acbbf0b3dc736eb9 Reviewed-on: https://go-review.googlesource.com/c/tools/+/584395 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Alan Donovan <adonovan@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
I still get a panic for a project that uses rangefunc. Apparently there is a unhandled switch case in SA4004.
go-tools/staticcheck/sa4004/sa4004.go Line 82 in dcae280
|
@fzipp should be fixed now. |
Also: remove t.Skips related to its types.Alias support, which is done (dominikh/go-tools#1523). A follow-up change will revert the workaround for missing buildir support for range-over-func (dominikh/go-tools#1494), which is also done. Change-Id: Ic3dff1e2d9616bc12d0ee2c98e81ca747491c0cc Reviewed-on: https://go-review.googlesource.com/c/tools/+/586076 Reviewed-by: Robert Findley <rfindley@google.com> Auto-Submit: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Currently, staticcheck can not analyze and panic
for range iter
withGOEXPERIMENT=rangefunc
Stacktrace
The text was updated successfully, but these errors were encountered: