TMI: Appetite for destructors
May. 17th, 2012 10:54 pmYesterday
Finishing up porting resource tests to use destructors. I got behavior I couldn't understand with one test, resource-cycle, so I'll ignore that for now and move on to resource-generic.Aside from having to prefix every field reference with self., the porting itself is pretty straightforward. (As I'd expect, since a class with a destructor is a pretty straightforward generalization of a resource.)
Random thought: I love seeing an internal compiler error -- it's much better than a program segfaulting -- because I know it's absolutely a bug no matter what, and that I can get a backtrace that will probably be helpful. In this case it was a non-exhaustive match in type_use::type_uses_for. Yet another reason why I despise alt check (Rust's non-exhaustive pattern-matching construct, like an incomplete case in Haskell) -- when I'm extending the compiler with new variants for a data type, I get less help from the compiler than I should otherwise.
( Cut for length )
Times when I have to remember extra hard to redact my debug statements before checking in code: when I'm feeling inarticulate and just use #debug("meow") to denote which alt pattern matched.