Correct detection of recursive functions with lambda expressions