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: inconsistent error message when identifier begins with invalid character #42114

Open
smasher164 opened this issue Oct 21, 2020 · 2 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@smasher164
Copy link
Member

What version of Go are you using (go version)?

go version go1.15.2 darwin/amd64

What did you do?

I tried to compile the following program: https://play.golang.org/p/379msfdOuwi

package main

func main() {
	var 3x = 3
	3x := 3  
	var $x = 3
	$x := 3
}

What did you expect to see?

./prog.go:4:6: syntax error: unexpected literal 3, expecting name
./prog.go:5:3: syntax error: unexpected literal 3, expecting name
./prog.go:6:6: invalid character U+0024 '$'
./prog.go:7:2: invalid character U+0024 '$'

What did you see instead?

./prog.go:4:6: syntax error: unexpected literal 3, expecting name
./prog.go:5:3: syntax error: unexpected x at end of statement
./prog.go:6:6: invalid character U+0024 '$'
./prog.go:7:2: invalid character U+0024 '$'
./prog.go:7:5: no new variables on left side of :=
@smasher164 smasher164 added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 21, 2020
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
@mknyszek mknyszek moved this to Triage Backlog in Go Compiler / Runtime Jul 15, 2022
@seankhliao seankhliao added this to the Unplanned milestone Aug 27, 2022
@rsc
Copy link
Contributor

rsc commented Jun 28, 2024

duplicate of #68183.

@rsc rsc closed this as completed Jun 28, 2024
@github-project-automation github-project-automation bot moved this from Triage Backlog to Done in Go Compiler / Runtime Jun 28, 2024
@griesemer
Copy link
Contributor

Reopening because it's not quite the same issue as #68183.

@griesemer griesemer self-assigned this Aug 1, 2024
@griesemer griesemer modified the milestones: Unplanned, Go1.24 Aug 1, 2024
@griesemer griesemer reopened this Aug 1, 2024
@github-project-automation github-project-automation bot moved this from Done to In Progress in Go Compiler / Runtime Aug 1, 2024
@griesemer griesemer modified the milestones: Go1.24, Backlog Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: In Progress
Development

No branches or pull requests

5 participants