| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
tree-sitter-dart represents an arrow-bodied function (int f() => x + 1;) as function_body containing the expression DIRECTLY — no return_statement node at all. dataflowDart's returnNode: 'return_statement' never matched, so arrow-bodied functions never recorded a returns entry, independent of #2182's sibling-body fix (this is a distinct semantic gap: an implicit return via => isn't modeled as a return at all). Adds a new implicitReturnBodyNode/blockBodyNode config pair to DataflowRulesConfig: when a configured node's only named child is not the block type, that child is recorded as an implicit return the same way handleReturn already does for a real return_statement (it only ever reads namedChildren[0], so it works unmodified regardless of the wrapper node's actual type). Enabled only for Dart (implicitReturnBodyNode: 'function_body') — no other language sets this, so this is purely additive. Rust's native engine has no Dart dataflow rules at all yet (tracked separately as #2359), so this is legitimately TS/WASM-only — no dual- engine parity gap for this specific fix. While verifying, found calls nested inside a return/other expression are never tracked at all for Dart (argFlows stays empty even for an ordinary block-bodied function) — a separate, pre-existing gap, unrelated to this fix. Filed as #2497. Closes #2356 Impact: 3 functions changed, 1 affected
Greptile SummaryThe PR adds Dart expression-bodied function support to the TypeScript/WASM dataflow analyzer.
Confidence Score: 5/5The PR appears safe to merge with no concrete correctness or security issues identified. The Dart-only configuration recognizes expression-bodied functions without changing other language rules, while the visitor still traverses expression children and avoids treating block bodies as implicit returns. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Dart function_body] --> B{Exactly one named child?}
B -->|No| E[Continue normal child traversal]
B -->|Yes| C{Child type is block?}
C -->|Yes| E
C -->|No| D[Record child expression as implicit return]
D --> E
Reviews (1): Last reviewed commit: "fix(dataflow): dart arrow-body functions..." | Re-trigger Greptile |
Sorry, something went wrong.
Codegraph Impact Analysis1 functions changed → 1 callers affected across 1 files
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Test plan
Closes #2356