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

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


Copy link

@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?


What did you do?

, running this code or inlined below

package main

func main() {

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 or

package main

func main() {
./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
Copy link

@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.

Copy link

@cagedmantis cagedmantis commented Dec 22, 2020

Copy link

@mdempsky mdempsky commented Jan 18, 2021

I think either error message is fine here. However, go/types reports the requested error message, so this will likely change once we adopt types2 anyway.

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

Successfully merging a pull request may close this issue.

None yet
4 participants