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: ugly error message for weird invalid program #20771

Closed
josharian opened this issue Jun 23, 2017 · 1 comment
Closed

cmd/compile: ugly error message for weird invalid program #20771

josharian opened this issue Jun 23, 2017 · 1 comment

Comments

@josharian
Copy link
Contributor

package p

var r = newReader()

func newReader() r
$ go tool compile x.go 
x.go:3:9: typechecking loop involving newReader
	x.go:3:18 newReader()
	x.go:3:5 r = newReader()
	x.go:3:5 r
	x.go:5:15 <T>
	x.go:5:18 newReader
	x.go:5:6 <node DCLFUNC>
x.go:5:18: r is not a type

This error message is ugly and inscrutable.

The same program features in #20770.

Marking as unplanned, because of the oddity and unlikeliness of the program.

Found with go-fuzz.

@ALTree
Copy link
Member

ALTree commented Sep 22, 2018

This looks fixed. In 1.10 and 1.11 the error message is:

# command-line-arguments
./test.go:5:6: missing function body
./test.go:5:18: r is not a type

Closing here.

@ALTree ALTree closed this as completed Sep 22, 2018
@golang golang locked and limited conversation to collaborators Sep 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants