Class literal access supported

This commit is contained in:
Valentin Kipyatkov
2016-08-28 23:53:38 +03:00
parent 4cab04b24b
commit 5c1e42aa51
4 changed files with 11 additions and 0 deletions
@@ -327,6 +327,13 @@ private class Processor(
}
}
}
is KtClassLiteralExpression -> {
if (element == parent.receiverExpression) { // ClassName::class
processSuspiciousExpression(element)
return true
}
}
}
if (element.getStrictParentOfType<KtImportDirective>() != null) return true // ignore usage in import
@@ -21,4 +21,6 @@ fun foo(x: X) {
val constructor = ::A
val (a3, b3) = constructor(1, 2)
val (a4, b4) = A::class.java.newInstance()
}
@@ -1,6 +1,7 @@
Checked type of (a1, b1)
Checked type of (a2, b2)
Checked type of (a3, b3)
Checked type of (a4, b4)
Checked type of X.f2()
Checked type of constructor
Checked type of fun2
@@ -1,3 +1,4 @@
Value read 19 val (a1, b1) = fun2()
Value read 20 val (a2, b2) = fun3()
Value read 23 val (a3, b3) = constructor(1, 2)
Value read 25 val (a4, b4) = A::class.java.newInstance()