Uast: consistency updates for ULambdaExpression

This commit is contained in:
Nicolay Mitropolsky
2018-01-18 20:12:56 +03:00
parent 25cd54713b
commit 2623ae714c
6 changed files with 34 additions and 3 deletions
+2
View File
@@ -5,6 +5,8 @@ import java.io.InputStream
fun foo() {
val runnable = object : Runnable { override fun run() {} }
runnable.run()
val runnable2 = Runnable { println() }
runnable2.run()
val closeableRunnable = object : Runnable, Closeable { override fun close() {} override fun run() {} }
val runnableIs = object : InputStream(), Runnable { override fun read(): Int = 0; override fun run() {} }
}
+15
View File
@@ -16,6 +16,21 @@ UFile (package = )
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier (run))
USimpleNameReferenceExpression (identifier = run)
UDeclarationsExpression
ULocalVariable (name = runnable2)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))
UIdentifier (Identifier (Runnable))
USimpleNameReferenceExpression (identifier = Runnable)
ULambdaExpression
UBlockExpression
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier (println))
USimpleNameReferenceExpression (identifier = println)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = runnable2)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier (run))
USimpleNameReferenceExpression (identifier = run)
UDeclarationsExpression
ULocalVariable (name = closeableRunnable)
UObjectLiteralExpression
+4
View File
@@ -5,6 +5,10 @@ public final class AnonymousKt {
public static final fun foo() : void {
var runnable: <ErrorType> = anonymous object : Runnable { override fun run() {} }
runnable.run()
var runnable2: java.lang.Runnable = Runnable({
println()
})
runnable2.run()
var closeableRunnable: <ErrorType> = anonymous object : Runnable, Closeable { override fun close() {} override fun run() {} }
var runnableIs: <ErrorType> = anonymous object : InputStream(), Runnable { override fun read(): Int = 0; override fun run() {} }
}