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: "invalid recursive type" should abort #28294

bep opened this issue Oct 20, 2018 · 1 comment

cmd/compile: "invalid recursive type" should abort #28294

bep opened this issue Oct 20, 2018 · 1 comment


Copy link

@bep bep commented Oct 20, 2018

This seems to be similar to #21273 (fixed in Go 1.10).

▶ go version
go version go1.11 darwin/amd64
package main

func main() {
	type int int
	type I int

	const i I = 1

The above fails with

./main.go:4:7: invalid recursive type int
./main.go:5:7: invalid recursive type I
./main.go:7:8: invalid constant type I

The above is clear enough in this small case, but I had this happen to me (again, an automatic refactoring gone wrong) in a bigger program and all I saw was a list of invalid constant type (that looked valid), and then too many errors.

Copy link

@meirf meirf commented Oct 20, 2018

Maybe this case should follow the same logic as here:

There's no need to tell me T is an invalid map key after telling me it's an invalid anything.

This case is trickier though since I is typed of the original error type.

cc @griesemer

@griesemer griesemer self-assigned this Oct 20, 2018
@griesemer griesemer added this to the Unplanned milestone Oct 20, 2018
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
3 participants