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

The compiler reportes a wrong line number #794

Open
zrcoder opened this issue Sep 9, 2021 · 1 comment
Open

The compiler reportes a wrong line number #794

zrcoder opened this issue Sep 9, 2021 · 1 comment

Comments

@zrcoder
Copy link
Contributor

zrcoder commented Sep 9, 2021

When I run codes below on the Go+ Playground,

type Person struct {
	Name string
	Age  int
}

p := Person{
	Name: "bar",
	Age:  30
}
println(p.Name)

got a compile error:

GenGoPkg .
main.gop:6:2: expected declaration (and 1 more errors)

Infact, the real error line is 8 (missed , after Age: 30), not 6.

@xushiwei
Copy link
Member

xushiwei commented Sep 9, 2021

There are more errors that are hidden.
So the real problem is how to show all errors.

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

No branches or pull requests

2 participants