This question is locked. New answers and comments are not allowed.
Hi there,
We have a somewhat complex method in our solution which uses Lambda Expressions to provide type-safe reflection.
Any calls to the method come up as invalid code, although it compiles and functions perfectly.
The method signature is:
void LogChangeTrackingEvent<T, X>(T object, Expression<Func<T, X>> propTransform, X newValue) where T : ITrackable;
So for example, to change the property MyProperty of object myObj of type MyClass, you'd call:
LogChangeTrackingEvent(myObj, o => o.MyProperty, newValue); |
No need to delve into the plumbing (splits up the Lambda expression in order to provide an automated tracking log), but this comes up with an error in JustCode.
An instance of type double? cannot be returned by a function of type double.
Note that in this instance MyProperty is of type double? and newValue is of type double.
Let me know if you need some more information on this, or if you can identify why this is showing up as bad code in JustCode.
Thanks!
Marcus