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
Labels
FrozenDueToAge 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

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 the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 17, 2018
@griesemer griesemer added this to the Unplanned milestone Sep 17, 2018
@griesemer griesemer self-assigned this Sep 17, 2018
@ALTree
Copy link
Member

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 as completed Jul 22, 2020
@golang golang locked and limited conversation to collaborators Jul 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants