Recurse upwards if the appropriate function was shadowed by another
similar-ending function call