mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Kotlin: Add a Kotlin 2 copy of the testsuite
This commit is contained in:
@@ -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
|
||||
@@ -0,0 +1 @@
|
||||
semmle/code/java/PrintAst.ql
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
public class Prop {
|
||||
// This will look like a property in Kotlin
|
||||
String getFoo() {
|
||||
return "foo";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
fun use(prop: Prop): String {
|
||||
return prop.foo
|
||||
}
|
||||
Reference in New Issue
Block a user