-
-
Notifications
You must be signed in to change notification settings - Fork 379
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
Lambda Invoke does not update arguments in the parameters array #252
Comments
I do have a fix for this ready local as it was blocking some of my testing of edge cases on collection initialization #250 , I would just like to confirm which path we want to go down. Do we want to update the Invoke call or add an additional call that supports the ref parameters? |
See also this comment: #251 (comment) |
I agree from a security perspective with what you said. In order for the underlying compiled Delegate to update the invoked objects, the parameter has to be declared as a ByRefType as follows Personally I think the cleanest option is to have a new Setting EnableByRefParameters that is off by default, and when it's enabled the ByRef still controls whether or not the ref/out parameter assignment can be accomplished. I think there would also be some merit in allowing this functionality in some way since there is a unit test specifically set up to allow setting to a parameter (Can_assign_a_parameter) |
Realized this is very similar to #31 |
Understandably, the Lambda class is essentially a wrapper around the parsed delegate due to the way we treat the parameter creation.
However, the way we currently implement the Invoke, the following fails.
If we had a reference to the actual delegate and performed a dynamic invoke on it with the args array, the Asserts would succeed.
The text was updated successfully, but these errors were encountered: