From d2b8bd5760c61ea79cf27e1ee7e98981f09a8ad5 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 3 Jun 2025 15:10:34 +0200 Subject: [PATCH] C#: Remove explicit (trivial) type requirements on Debug.Assert methods. --- .../lib/semmle/code/csharp/frameworks/system/Diagnostics.qll | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/system/Diagnostics.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/system/Diagnostics.qll index 14d7497ec33..b5c036fa9f4 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/system/Diagnostics.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/system/Diagnostics.qll @@ -41,9 +41,7 @@ class SystemDiagnosticsDebugClass extends SystemDiagnosticsClass { /** Gets an `Assert(bool, ...)` method. */ Method getAssertMethod() { result.getDeclaringType() = this and - result.hasName("Assert") and - result.getParameter(0).getType() instanceof BoolType and - result.getReturnType() instanceof VoidType + result.hasName("Assert") } }