-
-
Notifications
You must be signed in to change notification settings - Fork 91
Closed
Labels
Milestone
Description
The error occurs when I have a Convert expression returning Nullable, but I ignore the result. For example
[Test]
public void Case2_A()
{
var p = Parameter(typeof(int), "tmp0");
var expr =
Lambda<Action<int>>(Block(
Convert(p, typeof(int?)),
Default(typeof(void))), p);
var f = expr.CompileFast();
f(2);
}Or similar:
[Test]
public void Case2_B()
{
var p = Parameter(typeof(int), "tmp0");
var expr =
Lambda<Action<int>>(Convert(p, typeof(int?)), new[] { p });
var f = expr.CompileFast();
f(2);
}In these simple cases, I could just not place the ignored convert there, but it also fails in more complex cases when the conversion is nested in conditions/blocks, but the result is still not used in the end.