You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest release?
Yes.
Consider a chain of functions that call each other:
func f1(x X) { ... f2(y) ... }
func f2(y Y) { ... f3(z) ... }
and so on.
Assume also that their arguments and returns values are static Go types (no interfaces).
Generally, such a chain of statically-typed invocations will fall within the domain of the SSA optimizer and will be rewritten (theoretically) optimally.
The issue arises when the invocation chain is recursive, e.g.
Thank you for raising this issue. Unlike many projects on GitHub, the Go project does not use its bug tracker for general discussion or asking questions. We only use our bug tracker for tracking bugs and tracking proposals going through the Proposal Process.
What version of Go are you using (
go version
)?1.9
Does this issue reproduce with the latest release?
Yes.
Consider a chain of functions that call each other:
func f1(x X) { ... f2(y) ... }
func f2(y Y) { ... f3(z) ... }
and so on.
Assume also that their arguments and returns values are static Go types (no interfaces).
Generally, such a chain of statically-typed invocations will fall within the domain of the SSA optimizer and will be rewritten (theoretically) optimally.
The issue arises when the invocation chain is recursive, e.g.
func f1(x X) { ... f2(y) ... }
func f2(y Y) { ... f3(z) ... }
func f3(z Z) { ... f1(x) ... }
and the user desires to implement f1 and f3 in different packages.
This is not possible due to the design of the packaging system
(because the packages of f1 and f3 would have to import each other).
Consequently, large amounts of recursive code cannot be spread across packages.
This situation has arisen in practice, so I wonder what the language designers would advise.
Thank you.
The text was updated successfully, but these errors were encountered: