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

Compiler reject valid recursive types #1672

Closed
nsf opened this issue Apr 7, 2011 · 3 comments
Closed

Compiler reject valid recursive types #1672

nsf opened this issue Apr 7, 2011 · 3 comments

Comments

@nsf
Copy link

nsf commented Apr 7, 2011

package main

type X *[10]Y
type Y X

func main() {
}

//--------------------------------------------------------------
Compiler says:
test.go:3: invalid recursive type Y

Compiler version: cd89452cfea3 weekly/weekly.2011-04-04

I think these recursive types are perfectly valid, because X's size doesn't depend on
Y's size.
@rsc
Copy link
Contributor

rsc commented Apr 7, 2011

Comment 1:

This is a dup of another bug (can probably find by searching
for recursive).  I believe there is a fix CL pending.

@nsf
Copy link
Author

nsf commented Apr 7, 2011

Comment 2:

Indeed :)

@robpike
Copy link
Contributor

robpike commented Apr 7, 2011

Comment 3:

duplicate of 667

Status changed to Duplicate.

Merged into issue #667.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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

4 participants