fixed the bug that the first declaration inside a function cannt be recursive:
def foo() { def bar() { bar() }; bar() }; foo()  # bar cannot be found