Read Program.cs first, then run it: dotnet run --project reps/05. It prints:
open a
open b
dispose a
caught boom
finally
end
b is never disposed, not even after GC.Collect().
Read Program.cs first, then run it: dotnet run --project reps/05. It prints:
open a
open b
dispose a
caught boom
finally
end
b is never disposed, not even after GC.Collect().
dispose a come before caught boom, and not after it?
b? If your answer uses the word "eventually", keep looking.
b, and the smallest that makes the class safe even when somebody forgets?