Every time I've done something like that, Rails has pulled me up short
with a "stack level too deep" error. That's usually the only way you
can catch these things. Mistakes like this can't be caught
automatically, since a partial calling itself can sometimes be valid
(when displaying a tree, for instance).