Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions csharp/ql/src/Language Abuse/UselessCastToSelf.ql
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ where
type = cast.getTargetType() and
type = e.getType() and
not type instanceof NullType and
not type instanceof UnknownType and
not e.(ImplicitDelegateCreation).getArgument() instanceof AnonymousFunctionExpr
select cast, "This cast is redundant because the expression already has type " + type + "."
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: fix
---
* The query `cs/useless-cast-to-self` no longer reports casts when both the expression type and the cast target type are unknown, which can occur in `build-mode: none` databases.
Loading