-
-
Notifications
You must be signed in to change notification settings - Fork 92
Closed
Labels
Milestone
Description
I do not see these in code of pattern matching, probably these are not only ref issues
Next fails
void SetSmallConstant(ref double localByRef)
{
localByRef += 3.0;
}
var objRef = Parameter(typeof(double).MakeByRefType());
var lambda = Lambda<ActionRef<double>>(AddAssign(objRef, Constant((double)3.0)), objRef);
var compiledA = lambda.Compile();
var exampleA = default(double);
compiledA(ref exampleA);
Assert.AreEqual(3.0, exampleA);
var compiledB = lambda.CompileFast<ActionRef<double>>(true);
var exampleB = default(double);
compiledB(ref exampleB);
Assert.AreEqual(3.0, exampleB);
ActionRef<double> direct = SetSmallConstant;
var exampleC = default(double);
direct(ref exampleC);
Assert.AreEqual(3.0, exampleC);