-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime.closure() is being called for function literals that don't need it. #1894
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
Labels
Milestone
Comments
Labels changed: added compilerbug. Owner changed to @rsc. Status changed to Accepted. |
I'm not sure where the specification says that. It just says that "Function values are equal if they refer to the same function or if both are nil." The section on function literals doesn't mention anything about necessarily creating separate functions. One could argue that two functions resulting from the same function literal (which doesn't refer to local variables) refer to the same function since they can't be distinguished by calling them: they have the same results and the same side-effects. And they're written in the same place in the source... It *would* lead to a subtle difference in semantics between closing and non-closing function literals though, I suppose. |
Now that http://code.google.com/p/go/source/detail?r=c987cc71cf15 is in, this could be fixed. |
Owner changed to @lvdlvd. |
Pending in http://golang.org/cl/5516051 |
This issue was closed by revision ba25778. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by fvbommel:
The text was updated successfully, but these errors were encountered: