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

go/types: assertion failed error on type declaration cycle #18643

Closed
mdempsky opened this issue Jan 12, 2017 · 4 comments
Closed

go/types: assertion failed error on type declaration cycle #18643

mdempsky opened this issue Jan 12, 2017 · 4 comments
Milestone

Comments

@mdempsky
Copy link
Member

Running gotype on this code fails with an assertion failed panic:

package p
type T [10][10][len(T{}[0])]byte

Notably, go/types does accept this code (even though cmd/compile and gccgo report errors):

package p
type T [10][len(T{})]byte

Related: #13890

/cc @griesemer

@mdempsky mdempsky added this to the Go1.9 milestone Jan 12, 2017
@griesemer griesemer self-assigned this Jan 13, 2017
@gopherbot
Copy link

CL https://golang.org/cl/46393 mentions this issue.

gopherbot pushed a commit that referenced this issue Jun 22, 2017
Not a fix but useful for further debugging, and safe.

For #18643.

Change-Id: I5fb4f4a8662007a26e945fff3986347855f00eab
Reviewed-on: https://go-review.googlesource.com/46393
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
@gopherbot
Copy link

CL https://golang.org/cl/46467 mentions this issue.

@gopherbot
Copy link

Change https://golang.org/cl/112275 mentions this issue: go/types: better cycle reporting for some cyclic composite literals

@gopherbot
Copy link

Change https://golang.org/cl/115456 mentions this issue: go/types: better cycle reporting for some cyclic composite literals

gopherbot pushed a commit that referenced this issue May 31, 2018
To evaluate the type of composite literals, the type checker called
Checker.typ which breaks cycles. As a result, certain cycles were
not reported with actual cycle reporting, but caught due to other
uninitialized fields (with less nice error message).

The change now calls Checker.typExpr at the relevant call site.

For #18643.

Change-Id: Iecb3f0e1afb4585b85553b6c581212f52ac3a1c4
Reviewed-on: https://go-review.googlesource.com/115456
Reviewed-by: Alan Donovan <adonovan@google.com>
@golang golang locked and limited conversation to collaborators May 31, 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