Skip to content
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

go/types, types2: error reported for valid shifts #52080

Open
griesemer opened this issue Mar 31, 2022 · 1 comment
Open

go/types, types2: error reported for valid shifts #52080

griesemer opened this issue Mar 31, 2022 · 1 comment
Assignees
Labels
NeedsInvestigation
Milestone

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented Mar 31, 2022

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 griesemer added the NeedsInvestigation label Mar 31, 2022
@griesemer griesemer added this to the Go1.19 milestone Mar 31, 2022
@griesemer griesemer self-assigned this Mar 31, 2022
@gopherbot
Copy link

@gopherbot gopherbot commented Apr 5, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

2 participants