Warning when returning disposed object #64283
Unanswered
matthiaslischka
asked this question in
Ideas
Replies: 1 comment
-
The compiler shouldn't warn about this because it doesn't care about object lifetime on heap. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Returning a disposed object never makes sense, right?
Or are there any scenarios where it does?
Something like that
using
keyword here is very tricky to spot and dangerous.I was just wondering why there is no compiler warning or maybe I just missed it or have to configure it somehow?
BR Matthias
p.s.: original request from dotnet/roslyn
Beta Was this translation helpful? Give feedback.
All reactions