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
csharp: detector.py's ';' vs '{'/'=>' terminator shield is fooled by a lambda arrow inside multi-line call arguments #1428
bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginepriority: lowUI tweaks, documentation, and minor optimizationstestingUnit, integration, and E2E pipeline verificationthreat: false-positiveAccuracy tuning: Engine incorrectly flagged safe code
Found while independently verifying #1418 (csharp func_start Invocation Shield fix) -- a
separate, pre-existing false-positive class, confirmed NOT a regression from #1418 (reproduces
identically against the pre-#1418 regex too, since that path had no prefix requirement at all).
detector.py's own ; vs {/=> terminator shield (added for #789, around line 2016) can be
fooled by a lambda's => appearing inside a multi-line call statement's arguments, before the
statement's real terminating ;. This is a distinct mechanism from #1418's regex-level fix
(which operates in language_standards.py) -- a second, independent place csharp's "is this a
real function body-open or just an ordinary statement" judgment can go wrong.
Repro
language-crucible/data/csharp/roslyn/CSharpCompilation.cs (approximate shape, confirmed via a
minimal standalone repro file):
ReportManifestResourceDuplicates(moduleBuilder.ManifestResources,SourceAssembly.Modules.Skip(1).Select(m =>m.Name),// <-- this `=>` fools the shieldAddedModulesResourceNames(resourceDiagnostics),resourceDiagnostics);
detector.py's shield finds the => inside .Select(m => m.Name) before the statement's real
terminating ;, and treats it as if it were an expression-bodied member's own arrow -- misreports SourceAssembly.Modules.Skip as a function name.
Suggested fix shape
The shield needs to track paren/bracket depth (similar to how #1319's rust bodyless-declaration
handling tracks [/] depth to avoid a ; inside an attribute being mistaken for a statement
terminator) so an => found while still inside an unclosed argument-list paren doesn't count as
the statement's own arrow. Located in gitgalaxy/core/detector.py, the ;/{/=> terminator
logic around line 2016-2046.
Scope note
This only affects func_start/args/class_start name-extraction accuracy (the extraction-
gauntlet pillar from epic #813), not GitGalaxy's risk-scoring rules, which are unaffected.
bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginepriority: lowUI tweaks, documentation, and minor optimizationstestingUnit, integration, and E2E pipeline verificationthreat: false-positiveAccuracy tuning: Engine incorrectly flagged safe code
Activity
fix(csharp): make Invocation Shield terminator scan paren/bracket-dep…
fix(dart): extend Invocation Shield to closure-typed call arguments (#…