DynamicExpresso icon indicating copy to clipboard operation
DynamicExpresso copied to clipboard

Updating Lambda Invoke to support byref values.

Open holdenmai opened this issue 2 years ago • 0 comments

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]);

holdenmai avatar Aug 22 '22 19:08 holdenmai