mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Kotlin: Add test case for confusing overloading query
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql
|
||||
20
java/ql/test/kotlin/query-tests/ConfusingOverloading/Test.kt
Normal file
20
java/ql/test/kotlin/query-tests/ConfusingOverloading/Test.kt
Normal 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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user