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
Labels
early-in-cycle A change that should be done early in the 3 month dev cycle. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@griesemer
Copy link
Contributor

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 NeedsFix The path to resolution is known, but the work has not been done. early-in-cycle A change that should be done early in the 3 month dev cycle. labels Aug 20, 2018
@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

Related to #25773.

@gopherbot
Copy link

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

@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.
Labels
early-in-cycle A change that should be done early in the 3 month dev cycle. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants