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: alias type cycle inside function not recognized #27106

Closed
griesemer opened this issue Aug 20, 2018 · 2 comments
Closed

go/types: alias type cycle inside function not recognized #27106

griesemer opened this issue Aug 20, 2018 · 2 comments

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented Aug 20, 2018

A couple of examples of local alias type declarations that are not recognized as invalid:

func _() {
	type T1 chan [unsafe.Sizeof(func(ch T1) { _ = <-ch })]byte  // ok
	type T2 = chan [unsafe.Sizeof(func(ch T2) { _ = <-ch })]byte   // not ok
	type T3 func(T3)   // ok
	type T4 = func(T4)   // not ok
}

go/types accepts this function w/o complaints.

These bugs will disappear once we use the same (new) cycle detection mechanism that we introduced for 1.11 not just for globals, but also for locals.

@griesemer griesemer added this to the Go1.12 milestone Aug 20, 2018
@griesemer griesemer self-assigned this Aug 20, 2018
@griesemer
Copy link
Contributor Author

@griesemer griesemer commented Aug 20, 2018

Related to #25773.

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 21, 2018

Change https://golang.org/cl/130455 mentions this issue: go/types: track local cycles using same mechanism as for global objects

Loading

@gopherbot gopherbot closed this in ce2e883 Aug 30, 2018
@golang golang locked and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants