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

josharian opened this issue Jun 23, 2017 · 1 comment


None yet
2 participants
Copy link

commented Jun 23, 2017

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.


This comment has been minimized.

Copy link

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 Sep 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.