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

Open
griesemer opened this Issue Sep 17, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@griesemer
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment