make hasReturnStatementInIf recursive