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 · 10 comments
Open

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

griesemer opened this issue Mar 31, 2022 · 10 comments
Assignees
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@griesemer
Copy link
Contributor

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 Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. 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

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

@griesemer
Copy link
Contributor Author

Didn't get to this. Moving to 1.20.

@griesemer griesemer modified the milestones: Go1.19, Go1.20 Jun 23, 2022
@griesemer griesemer added the early-in-cycle A change that should be done early in the 3 month dev cycle. label Jun 23, 2022
@gopherbot
Copy link

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
Copy link

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

gopherbot pushed a commit that referenced this issue Sep 2, 2022
CL 425735 consolidated the testdata/check/shifts.go files between
go/types and types2. Because some shifts don't work correctly with
types2, the corresponding tests were disabled in the shared file.
Make sure we keep testing those shifts for go/types by adding a
local test file.

For #52080.
For #54511.

Change-Id: I53507e535bf83b204eaf18fc6c2efefcebf5ebf7
Reviewed-on: https://go-review.googlesource.com/c/go/+/426661
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
@griesemer griesemer modified the milestones: Go1.20, Go1.21 Nov 15, 2022
@gopherbot
Copy link

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.

@griesemer
Copy link
Contributor Author

Pushing ahead again.

@griesemer griesemer modified the milestones: Go1.21, Go1.22 Jun 1, 2023
@gopherbot
Copy link

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.

@griesemer
Copy link
Contributor Author

Moving once more.

@griesemer griesemer modified the milestones: Go1.22, Go1.23 Oct 31, 2023
@gopherbot
Copy link

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.

@griesemer
Copy link
Contributor Author

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 griesemer removed the early-in-cycle A change that should be done early in the 3 month dev cycle. label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: No status
Development

No branches or pull requests

2 participants