diff --git a/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql b/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql index e3ac1384243..6034d35bff3 100644 --- a/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql +++ b/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql @@ -137,6 +137,8 @@ private predicate delegate(Method caller, Method callee) { from Method m, Method n, string messageQualifier where + // Exclude compiler generated methods, such as Kotlin `$default` methods: + not m.isCompilerGenerated() and confusinglyOverloaded(m, n) and ( if m.getDeclaringType() = n.getDeclaringType() diff --git a/java/ql/test/kotlin/query-tests/ConfusingMethodSignature/ConfusingMethodSignature.expected b/java/ql/test/kotlin/query-tests/ConfusingMethodSignature/ConfusingMethodSignature.expected index 59956f2674d..e69de29bb2d 100644 --- a/java/ql/test/kotlin/query-tests/ConfusingMethodSignature/ConfusingMethodSignature.expected +++ b/java/ql/test/kotlin/query-tests/ConfusingMethodSignature/ConfusingMethodSignature.expected @@ -1 +0,0 @@ -| Test.kt:12:5:12:45 | fn$default | Method A.fn$default(..) could be confused with overloaded method $@, since dispatch depends on static types. | Test.kt:13:5:13:40 | fn$default | fn$default |