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 func_start consumes a multi-line @Deprecated(...) annotation as a return-type prefix, poisoning args count #2341
Dart's func_start regex treats a multi-line annotation whose arguments span several lines -- @Deprecated('...' '...',) is the corpus example -- as part of the following declaration's return-type prefix, so the match spans from @Deprecated( through the real declaration name.
Downstream, _count_top_level_args (or the args regex) then finds the annotation's own (...) first and counts its arguments instead of the real parameter list.
Confirmed impact
The last 6 entries of dart/function/args/agree[none]_vs[gitgalaxy,tree_sitter] after #2309's
three other fixes, all this one shape:
file:line
symbol
gg args
ts args (correct)
editable_text.dart:405
ToolbarOptions (const ctor)
0
4
framework.dart:7017
RootRenderObjectElement (ctor)
0
1
semantics.dart:1105
flags (getter)
1
0
semantics.dart:6301
isFocusable (getter)
1
0
object.dart:1372
debugOutstandingSemanticsHandles (getter)
1
0
theme_data.dart:1460
buttonBarTheme (getter)
1
0
Each has a multi-line @Deprecated(\n '...'\n '...',\n) immediately above it.
Note
Single-line annotations (@Annotation('test'), already covered by test_dart_func_start_valid)
are fine -- the return-type-prefix consumption only wanders when the annotation's argument list
carries a newline and a top-level comma. A naive "don't let the prefix cross a )" fix is
risky: the prior #2308/#2309 investigation found the prefix scan legitimately needs to cross > for generic method type-parameter bounds, and #2311 deliberately left extends out of an implements/with fix for the same ambiguity -- so this needs the same regression discipline
(crucible_check + the tree-sitter args baseline) as those.
Found via #2309 / the dart tri-comparison args exploration.
Activity
fix(dart): anchor the args span at the name, not a leading @annotation (