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

cmd/compile: extra (confusing) error message after shift error #27712

Closed
griesemer opened this issue Sep 17, 2018 · 1 comment
Closed

cmd/compile: extra (confusing) error message after shift error #27712

griesemer opened this issue Sep 17, 2018 · 1 comment
Assignees
Milestone

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented Sep 17, 2018

package main

func main() {
	var s uint
	var _ interface{} = 1.0 << s
}

produces

prog.go:5:6: cannot use 1 << s as type interface {} in assignment
prog.go:5:26: invalid operation: 1 << s (shift of type float64)

on the playground (https://play.golang.org/p/lZceKWg78OH). The first error message is misleading and unnecessary. Should suppress once we know that the shift is invalid.

Not urgent.

@griesemer griesemer added this to the Unplanned milestone Sep 17, 2018
@griesemer griesemer self-assigned this Sep 17, 2018
@ALTree
Copy link
Member

@ALTree ALTree commented Jul 22, 2020

This appears to be fixed, the reproducer above now generates a single error line:

./prog.go:5:6: invalid operation: 1 << s (shift of type float64)

Closing here.

@ALTree ALTree closed this Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.