Confusing "exception is discarded" in exceptions#how-exceptions-are-handled page #4111
Unanswered
jinek
asked this question in
Language Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The page: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/exceptions#how-exceptions-are-handled
(source: https://github.com/dotnet/csharplang/blob/master/spec/exceptions.md)
contains:
The statement "no base class destructor" is not clear, because any type has in its hierarchy System.Object which has desctructor. This way the sentance is logically always false and does not make sense.
If that stands for the direct base class, then the statement "exception is discarded" is not true as seen by running this application:
The result is
Which means that exception from finalizer hits the root of the stack which then is handled as any other exception thrown not from finalizers.
This particular article is used as a reference in some other documentation parts.
Beta Was this translation helpful? Give feedback.
All reactions