> Why not simply add an `is_closed` flag and throw an error if it is?
That's a way of doing it at runtime. The article describes catching the error at compile time.
That's a way of doing it at runtime. The article describes catching the error at compile time.