go icon indicating copy to clipboard operation
go copied to clipboard

go/types, types2: error reported for valid shifts

Open griesemer opened this issue 3 years ago • 11 comments

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

griesemer avatar Mar 31 '22 17:03 griesemer

Change https://go.dev/cl/398316 mentions this issue: types2: don't report an error for certain valid shifts

gopherbot avatar Apr 05 '22 03:04 gopherbot

Didn't get to this. Moving to 1.20.

griesemer avatar Jun 23 '22 18:06 griesemer

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.

gopherbot avatar Aug 12 '22 14:08 gopherbot

Change https://go.dev/cl/426661 mentions this issue: go/types: test shifts that are disabled in shared test file

gopherbot avatar Sep 01 '22 00:09 gopherbot

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.

gopherbot avatar Mar 02 '23 17:03 gopherbot

Pushing ahead again.

griesemer avatar Jun 01 '23 22:06 griesemer

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.

gopherbot avatar Jul 20 '23 20:07 gopherbot

Moving once more.

griesemer avatar Oct 31 '23 16:10 griesemer

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.

gopherbot avatar Jan 22 '24 16:01 gopherbot

This has been open for some time w/o causing major issues - though it should be fixed. Removing "early in cycle" label for now.

griesemer avatar Feb 06 '24 22:02 griesemer

Didn't get to this. Moving to 1.24.

griesemer avatar May 16 '24 20:05 griesemer