One suggestion here...we don't care so much about calls to `warn` as we do about warnings emitted by the ruby interpretter itself (which I don't think go through `warn`...).  It might be worth triggering a ruby interpretter warning here (using an expression like `k = 5 unless @undefined_ivar`) rather than calling `warn` directly since that's what we care about the most.