Skip to content

dart func_start: three residual false-positive/recall gaps left when #2072 was closed as complete #2308

Closed

Description

@squid-protocol

Context

Follow-up from #2072, which was closed (stateReason: COMPLETED) by PR #2129 on 2026-08-22.
#2129's own description says it "adds . to Dart's return-type charclass so dotted return types
... are properly captured" and "removes the arbitrary 200-character terminator search limit for
colon initializer lists ... recovering constructors with large initializer lists like
EditableText and _DiscreteKeyFrameSimulation._." That only covers items 3 and 4 of #2072's own
six numbered items — items 1, 2, 5, and 6 were never actually fixed, so closing #2072 as complete
was premature. This issue re-files the still-open scope, found via a fresh
tri_comparison_gatherer.gather_language("dart") name-diff against current main (2026-08-26),
cross-checked with direct regex tests against LANGUAGE_DEFINITIONS["dart"]["rules"]["func_start"].

Confirmed root causes (not fixed)

1. A multi-line with/implements class-header clause can still leak implements/with/
extends through as an ordinary prefix token, false-positive-matching the following identifier as
a phantom function.
The regex's (?!(?:implements|with|extends)\b) guard is only checked once,
immediately after the leading ^[ \t]* — it does not re-fire for occurrences of those keywords
consumed later, mid-sequence, inside the return-type-prefix token loop
((?:(?:[\w<>\[\],.?]|\(...\))+[ \t\n]+){0,4}?...), whose own internal exclusion list
(class|mixin|enum|extension|typedef|if|for|...|Function) never included implements/with/
extends at all. Confirmed via direct regex test against the real corpus
(language-crucible/data/dart/flutter/editable_text.dart:2480-2486):

class EditableTextState extends State<EditableText>
    with
        AutomaticKeepAliveClientMixin<EditableText>,
        WidgetsBindingObserver,
        TickerProviderStateMixin<EditableText>,
        TextSelectionDelegate,
        TextInputClient
    implements AutofillClient {

func_start.finditer() returns a match starting at the WidgetsBindingObserver, line (4 mixin
names consumed as prefix tokens, implements consumed as the 5th/final mandatory prefix token,
landing on AutofillClient as the captured NAME) — a real, phantom "function" that isn't one.

2. Bodyless default/named constructors (ClassName();) still don't regex-match at all.
Confirmed via direct regex test — zero matches for either shape:

// flutter/semantics.dart:656-658
class ChildSemanticsConfigurationsResultBuilder {
  ChildSemanticsConfigurationsResultBuilder();

// flutter/editable_text.dart:6705-6706 and 6738-6739
class _EditableTextTapOutsideAction extends ContextAction<EditableTextTapOutsideIntent> {
  _EditableTextTapOutsideAction();
class _EditableTextTapUpOutsideAction extends ContextAction<EditableTextTapUpOutsideIntent> {
  _EditableTextTapUpOutsideAction();

This is the same shape #2072 item 5 already flagged as "a distinct recall gap, possibly related to
the existing bodyless-constructor handling that other languages already solved (rust #1319, objc
#1336)". ChildSemanticsConfigurationsResultBuilder was previously listed in #2072 item 6 as "not
yet individually traced" — it's the identical bodyless-constructor mechanism as item 5, not a
separate cause.

3. A colon-initializer-list constructor using assert(...) clauses regex-matches but still
doesn't reach the final pipeline output — the same detector.py-level bug class as #2072 item 3,
confirmed NOT fixed by #2129 despite that PR's stated goal.
Example
(flutter/semantics.dart:7023-7029):

class OrdinalSortKey extends SemanticsSortKey {
  const OrdinalSortKey(this.order, {super.name})
    : assert(order > double.negativeInfinity),
      assert(order < double.infinity);

Direct regex probe confirms func_start.finditer() does match const OrdinalSortKey here (the
raw regex is fine). But tri_comparison_gatherer.gather_language("dart")'s post-pipeline
gg_funcs list still doesn't contain OrdinalSortKey — meaning detector.py's downstream
extraction/naming logic drops it before it reaches consumers, same class of bug #2072 item 3
described for EditableText's own constructor (which #2129 did fix). Whatever allowlist/condition
#2129 added to recover EditableText and _DiscreteKeyFrameSimulation._ evidently doesn't
generalize to this assert-based initializer-list shape.

Confirmed still-reproducing, not yet individually root-caused

A fresh gather_language("dart") name-diff against current main also still shows these as
extra_in_gg (false positives) in flutter/navigator.dart and flutter/object.dart:
_RestorationInformation.anonymous, _RestorationInformation.named, nodeToEnsureGeometry.toList,
targetFrameMatch.group — the same ternary-:/cascade-conflated-with-initializer-list shape
#2072 item 2 flagged. A synthetic regex test isolating just the call-site snippet didn't reproduce
it in this pass (needs the real surrounding ternary/method context, not a trimmed fragment) — filed
here for tracking rather than silently dropped, per this repo's own discipline that "diagnosed, not
yet fixed" should stay visible rather than get lost when a tracking issue closes.

Scope note

None of these are as individually high-leverage as #2071's fix (~126 occurrences). Good candidates
for a future harden-language-extraction or tri-comparison-ledger-sweep pass on dart. The
dart/function/existence/* tri-comparison ledger shapes remain status: validated from the
2026-08-21 sweep and are stale relative to this finding — they should be re-verified against a
fresh --all --write regen once this issue (or a subset of it) is fixed.

🤖 Filed with Claude Code

Activity

  1. added
    bug
    core-engine
    threat: false-positive
    threat: false-negative
    on Aug 27, 2026
  2. added this to the v2.4.9 milestone on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-enginethreat: false-negativethreat: false-positive

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions