Allow byref-like closure over byref(-like) locals #10211
Unanswered
GeeLaw
asked this question in
Language Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
An enhancement of #10209 #10210 . This is moved from discussion 10210 reply 2 with the example improved.
Abstract. A closure implemented by a byref-like value type should be able to close over byref(-like) locals. Those locals should be captured by pointer. This is safe as long as the byref-like value is
scopedfor the receiving method.Example. Suppose
and consider the following usage
The intended output is
A correct transformation appears to be
Example 2. Suppose
string.Createis implemented using value delegates...Beta Was this translation helpful? Give feedback.
All reactions