Merge pull request #11045 from tamasvajk/kotlin-confusing-default

Kotlin: Excluded compiler generated methods from `java/confusing-method-signature`
This commit is contained in:
Tamás Vajk
2022-11-08 10:25:36 +01:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@@ -57,6 +57,8 @@ private predicate candidateMethod(RefType t, Method m, string name, int numParam
m.getNumberOfParameters() = numParam and
m = m.getSourceDeclaration() and
not m.getAnAnnotation() instanceof DeprecatedAnnotation and
// Exclude compiler generated methods, such as Kotlin `$default` methods:
not m.isCompilerGenerated() and
not whitelist(name)
}

View File

@@ -7,3 +7,8 @@ class C {
prop(this)
}
}
class A {
fun <T : Any> fn(value: T, i: Int = 1) {}
fun fn(value: String, i: Int = 1) {}
}