Kotlin: Add test case for confusing overloading query

This commit is contained in:
Tamas Vajk
2022-11-16 11:57:05 +01:00
parent c70f3d35d0
commit 55dc929a1f
3 changed files with 6 additions and 0 deletions

View File

@@ -0,0 +1 @@
Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql

View File

@@ -0,0 +1,20 @@
class C {
var p: Int
get() = 1
set(value) {}
fun fn() {
val prop = C::p
prop(this)
}
}
class A {
fun <T : Any> fn(value: T, i: Int = 1) {}
fun fn(value: String, i: Int = 1) {}
}
class Foo {
val str by lazy {
"someString"
}
}