Revert "Fix functions referencing themselves not throwing a recursion error."

This reverts commit 7429fdee950e37ada9933d812917da5c990fa420.
Add test for recursion.