(&mut self, node: Node<'t>, depth: u32, walked: &HashSet<usize>)
| 1533 | } |
| 1534 | |
| 1535 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32, walked: &HashSet<usize>) { |
| 1536 | stack_guard!(); |
| 1537 | if depth > 12 { |
| 1538 | return; |
| 1539 | } |
| 1540 | // Subtrees the body walker has already been through. |
| 1541 | if walked.contains(&node.id()) { |
| 1542 | return; |
| 1543 | } |
| 1544 | // functionTypes is EMPTY for C#; the literal halt list applies — |
| 1545 | // lambda_expression IS C#'s lambda, so a lambda the scan reaches (a |
| 1546 | // top-level statement's) stops it; anonymous_method_expression is NOT |
| 1547 | // listed and scans through. Member initializers are walked instead. |
| 1548 | if depth > 0 |
| 1549 | && matches!( |
| 1550 | node.kind(), |
| 1551 | "arrow_function" | "function_expression" | "lambda_literal" | "lambda_expression" |
| 1552 | ) |
| 1553 | { |
| 1554 | return; |
| 1555 | } |
| 1556 | self.maybe_capture_fn_refs(node); |
| 1557 | for c in node.named_children(&mut node.walk()) { |
| 1558 | self.scan_fn_ref_subtree(c, depth + 1, walked); |
| 1559 | } |
| 1560 | } |
| 1561 | |
| 1562 | fn flush_fn_ref_candidates(&mut self) { |
| 1563 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected