-
-
Notifications
You must be signed in to change notification settings - Fork 92
Closed
Description
Hey there!
First of all, great project - I have an OO mapper and have encountered a few issues, but I've had some awesome results, so thanks!
First issue: I had a simple compiled func which turned a boolean false argument passed into it to true. I can't honestly say I have a great understanding of IL, but I fixed it by changing this line in TryEmitParameter
:
var asAddress = (parent == ExpressionType.Call || parent == ExpressionType.MemberAccess) && paramExpr.Type.IsValueType() && !paramExpr.IsByRef;
...to:
var asAddress =
(parent == ExpressionType.Call || parent == ExpressionType.MemberAccess) &&
paramExpr.Type.IsValueType() &&
!paramExpr.Type.IsPrimitive() && // <- don't bother for bool, int, etc
!paramExpr.IsByRef;
I offer this more as a suggestion - like I say I'm not that familiar with IL.
Cheers,
Steve