Closed GoogleCodeExporter closed 9 years ago
Thank you for reporting this very interesting and very important bug!
While Unquote did take measures to strip outermost reflective
TargetInvocationExceptions, it did not account for a unique case in F# where
there may be nested TargetInvocationExceptions.
The case is this: sometimes when core operators such as raises are invoked from
assemblies which are not compiled by F# (such as through the .NET reflection
assemblies, an implementation detail of Unquote's quotation evaluator), the
operators themselves are exposed as reflective calls, so in the case of this
bug we get to levels of reflective calls and therefore two nested
TargetInvocationExceptions.
This issue has been fixed in trunk and will be available in a new release very
soon.
Note that stripping nested TargetInvocationExceptions in this way forces us
into a compromise: we effectively cannot test for
raises<TargetInvocationException> because we can't always tell whether the
intention is to preserve or strip those reflective exceptions.
While fixing this issue I also decided to use a different strategy for
preserving stacktraces when extracting inner exceptions from (possibly nested)
TargetInvocationExceptions. Instead of using the PrepForRemoting() non-public
method on the exception, which in addition to preserving the stack trace also
produces a verbose message as you've seen, I am now using a strategy which only
preserves the stack trace and uses the original message. I think this is closer
to what folks would expect if F# provided native "eval", reflection is just an
implementation detail.
Original comment by stephen....@gmail.com
on 6 Aug 2011 at 3:18
Original comment by stephen....@gmail.com
on 7 Aug 2011 at 6:04
Original issue reported on code.google.com by
tech.ekon.us
on 3 Aug 2011 at 2:23