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
Java/C# explicit_casts: a parenthesised capitalised condition (if (DEBUG) log(x);) counts as a cast #9424
Found by the SOP-002 gap-cell decoy suite (protocol SOP-002-v1, epic #8863).
Construct: a parenthesised capitalised identifier followed by a statement, i.e. the condition of an if / while with no braces. The explicit_casts rule reads (Name) x as a cast to type Name.
Snippets (each should give 0 explicit_casts):
Java: if (DEBUG) log(x);, while (RUNNING) tick();, if (Ready) go();
C#: if (IsReady) Run();, if (DEBUG) Log();
Expected: 0 hits. A parenthesised condition is not a conversion (contract: "a cast expression, a conversion call or a cast keyword", signal_contracts.py). Actual: 1 hit each. PascalCase properties and UPPER_CASE constants in single-statement conditions are common in both languages.
Rules: gitgalaxy/standards/language_standards/languages/java.py (explicit_casts: \(\s*(?:...|[A-Z][A-Za-z0-9_]*)\s*\)\s*[a-zA-Z_$]) and csharp.py (same shape, second branch).
Locked in tests/decoys/test_decoy_java.py and tests/decoys/test_decoy_csharp.py as xfail(strict=True).
Activity