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: panic.Fatalf should not report "use of builtin panic not in function call" but instead "panic.Fatalf undefined (builtin panic has no field or method Fatalf)" #43285

Open
odeke-em opened this issue Dec 20, 2020 · 2 comments

Comments

@odeke-em
Copy link
Member

@odeke-em odeke-em commented Dec 20, 2020

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

At pre-Go1.16 on tip 55b5801

Does this issue reproduce with the latest release?

Yes

What did you do?

, running this code https://play.golang.org/p/akRcEUKPrTA or inlined below

package main

func main() {
	panic.Fatalf("foo")
}

What did you expect to see?

panic.Fatalf undefined (builtin panic has no field or method Fatalf)

What did you see instead?

use of builtin panic not in function call

which would be similar to panic being present on a line but without any invocation https://play.golang.org/p/35T1E3Xttpp or

package main

func main() {
	panic
}
./prog.go:4:2: use of builtin panic not in function call
@odeke-em odeke-em added this to the Unplanned milestone Dec 20, 2020
@choleraehyq
Copy link
Contributor

@choleraehyq choleraehyq commented Dec 20, 2020

How to figure out whether an error message is wrong? There is no specification about it. IMHO the current error message is not confusing.

@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Dec 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
3 participants
You can’t perform that action at this time.