Skip to content

docs(agents): add CodeQL's useless type test to the static-analysis traps - #556

Merged
DeepDiver1975 merged 1 commit into
mainfrom
docs/codeql-useless-type-test
Oct 3, 2026
Merged

DeepDiver1975 merged 1 commit into
mainfrom
docs/codeql-useless-type-test

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Adds one bullet to AGENTS.md › Static analysis: never type-test a value against a type it already is (cs/useless-type-test).

The build doesn't catch this: no compiler or analyzer warning, so make clean ci passes, and the alert only shows up from code scanning on the pull request. That happened on #555, where visual is ILogical logical was always true because every Avalonia Visual is an ILogical. The bullet names that case and gives the quick proof: delete the test and build.

Docs only, so no changelog entry.

🤖 Generated with Claude Code

…raps

The build does not warn about a pattern match against a type the value
already has, so it only surfaces as a code-scanning alert on the pull
request, as it did on #555 (Visual is always an ILogical).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975
DeepDiver1975 merged commit e8b53e3 into main Oct 3, 2026
9 of 12 checks passed
@DeepDiver1975
DeepDiver1975 deleted the docs/codeql-useless-type-test branch October 3, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant