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 · 3 comments
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

@odeke-em
Copy link
Member

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 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 cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 22, 2020
@cagedmantis
Copy link
Contributor

/cc @randall77 @griesemer

@mdempsky
Copy link
Member

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.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
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
None yet
Development

No branches or pull requests

5 participants