You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dart: branch counts nullable ? and ?. (precision 0.76); closures counts => on named functions (precision 0.32) #8906
Two Dart families count things that are not what the contracts name. Found with a Dart oracle on flutter's widgets (7,020 functions matched; args 1.00 / 1.00, so the oracle reads functions correctly):
branch counts the ? of nullable types and null-aware access (recall 1.00, precision 0.76; all 845 false-positive functions contain a ?). The Dart rule (dart.py, the branch regex, ~line 82) matches a bare ?. A nullable type T? and the null-aware ?. are not decisions; the contract counts the ternary at its ? and ?? as one value-selection decision (docs/branch_rule_contract.md, "Java's : and ?" and the value-selection dual).
closures counts => expr on a named function (precision 0.32). An arrow body (int arrow(int a) => a + 1;) is the function's own body, not an anonymous callable ("the syntax that opens an anonymous callable ... at the point it is defined").
Reproduce (scanned with the pinned scanner; counts read from function_data)
int?nullable(int? a) { return a; } // struct_branch == 2, should be 0intchain(Foo? a) { return a?.x; } // 2, should be 0intopt(Foo? a) { return a?.x ??1; } // 3, should be 1 (only `??`)intarrow(int a) => a +1; // struct_closures == 1, should be 0List<List<int>> generics(List<List<int>> m) { return m; } // bitwise_ops == 2, should be 0intrealIf(int a) { if (a >1) { return1; } return0; } // branch 1, correct
Expected
Anchor the ? on ternary position (the model is java's, #2833: (?<!\w)\? with the generic wildcard exclusions) and count ?? once; do not count ?. or T?. Count a closures hit only for a function expression used as a value (an anonymous (x) => ... or () { ... } argument or assignment), not the => of a declaration.
Part of #8863. Time the change; rosetta:rebless-owed if counts move; add each case as a test.
Claimed by promoter-bot host melek, lease renewed 2026-11-23T12:11Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove the claim:melek label.
Activity
squid-protocol commentedon Nov 22, 2026
Claimed by promoter-bot host
melek, lease renewed 2026-11-23T12:11Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove theclaim:meleklabel.bless: dartdoom DOOM-rosetta golden for dart branch/closures/bitwise_…
bless: regenerate merged golden snapshots after main merge (#8906)
squid-protocol commentedon Nov 23, 2026
Fixed by #9111 (merged as fcc440b), which carried this issue's PR (rebuilt with eight others to re-bless the golden snapshots once).