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,22 @@
Prop.java:
# 0| [CompilationUnit] Prop
# 2| 1: [Class] Prop
# 4| 2: [Method] getFoo
# 4| 3: [TypeAccess] String
# 4| 5: [BlockStmt] { ... }
# 5| 0: [ReturnStmt] return ...
# 5| 0: [StringLiteral] "foo"
Use.kt:
# 0| [CompilationUnit] Use
# 0| 1: [Class] UseKt
# 2| 1: [Method] use
# 2| 3: [TypeAccess] String
#-----| 4: (Parameters)
# 2| 0: [Parameter] prop
# 2| 0: [TypeAccess] Prop
# 2| 5: [BlockStmt] { ... }
# 3| 0: [ReturnStmt] return ...
# 3| 0: [ImplicitNotNullExpr] <implicit not null>
# 3| 0: [TypeAccess] String
# 3| 1: [MethodCall] getFoo(...)
# 3| -1: [VarAccess] prop

View File

@@ -0,0 +1 @@
semmle/code/java/PrintAst.ql

View File

@@ -0,0 +1,7 @@
public class Prop {
// This will look like a property in Kotlin
String getFoo() {
return "foo";
}
}

View File

@@ -0,0 +1,4 @@
fun use(prop: Prop): String {
return prop.foo
}