DynamicExpresso
DynamicExpresso copied to clipboard
Updating Lambda Invoke to support byref values.
Implementation to resolve #252.
This needs to be completed prior to #250 since it depends on this logic to work in order to test some of the edge cases with combining variable/parameter setting in the Add methods.
Usage
var a = 1;
var parameters = new[]{
new Parameter(nameof(a), typeof(int).MakeByRefType())
};
var lambda = target.Parse("2 + (a = a + 3)", parameters);
var args = new object[] { a };
var result = lambda.Invoke(args);
Assert.AreEqual(2 + (a + 3), result);
a += 3;
Assert.AreEqual(a, args[0]);