Kotlin: Add a Kotlin 2 copy of the testsuite

This commit is contained in:
Ian Lynagh
2023-10-26 13:13:28 +01:00
parent e6f31c965e
commit 905583e00a
625 changed files with 32808 additions and 0 deletions

View File

@@ -0,0 +1 @@
DeadCode/DeadClass.ql

View File

@@ -0,0 +1 @@
DeadCode/DeadMethod.ql

View 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()
}