public void ImmediatelyHandlingDisposedClosure() { using (var disposableObject = new DisposableObject()) { // HandleAction can be marked [InstantHandle] to narrow the scope of the analysis HandleAction(() => disposableObject.DoSomething(42)); } }
public void AccessingDisposedClosure() { using (var disposableObject = new DisposableObject()) { // Cannot fix this without rewriting - genuine bug SetAction(() => disposableObject.DoSomething(42)); } CallAction(); }