mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Kotlin: Add a Kotlin 2 copy of the testsuite
This commit is contained in:
@@ -0,0 +1 @@
|
||||
DeadCode/DeadClass.ql
|
||||
@@ -0,0 +1 @@
|
||||
DeadCode/DeadMethod.ql
|
||||
31
java/ql/test-kotlin2/query-tests/DeadCode/Test.kt
Normal file
31
java/ql/test-kotlin2/query-tests/DeadCode/Test.kt
Normal file
@@ -0,0 +1,31 @@
|
||||
sealed interface DbAddexpr
|
||||
|
||||
class Label<T> {
|
||||
}
|
||||
|
||||
fun <T> getFreshIdLabel(): Label<T> {
|
||||
return Label()
|
||||
}
|
||||
|
||||
fun foo(): Label<DbAddexpr> {
|
||||
val x = getFreshIdLabel<DbAddexpr>()
|
||||
return x
|
||||
}
|
||||
|
||||
fun main1() {
|
||||
print(foo())
|
||||
}
|
||||
|
||||
class Foo {
|
||||
data class DC(val x: Int, val y: Int)
|
||||
|
||||
fun foo() {
|
||||
val dc = DC(3, 4)
|
||||
print(dc.x)
|
||||
print(dc.y)
|
||||
}
|
||||
}
|
||||
|
||||
fun main2() {
|
||||
Foo().foo()
|
||||
}
|
||||
Reference in New Issue
Block a user