go/types, types2: error reported for valid shifts
Extracted from test/shift1.go which is currently not passing (excluded) in 1.18:
package p
func _(x int, s uint) {
x = (1. << s) << (1 << s)
x = (1. << s) << (1. << s)
}
reports
x.go:4:6: invalid operation: shifted operand (1. << s) (untyped float value) must be integer
x.go:5:6: invalid operation: shifted operand (1. << s) (untyped float value) must be integer
These should probably be valid. Regression.
cc @findleyr
Change https://go.dev/cl/398316 mentions this issue: types2: don't report an error for certain valid shifts
Didn't get to this. Moving to 1.20.
This issue is currently labeled as early-in-cycle for Go 1.20. That time is now, so a friendly reminder to look at it again.
Change https://go.dev/cl/426661 mentions this issue: go/types: test shifts that are disabled in shared test file
This issue is currently labeled as early-in-cycle for Go 1.21. That time is now, so a friendly reminder to look at it again.
Pushing ahead again.
This issue is currently labeled as early-in-cycle for Go 1.22. That time is now, so a friendly reminder to look at it again.
Moving once more.
This issue is currently labeled as early-in-cycle for Go 1.23. That time is now, so a friendly reminder to look at it again.
This has been open for some time w/o causing major issues - though it should be fixed. Removing "early in cycle" label for now.
Didn't get to this. Moving to 1.24.