Supported usage in super type list without parenthesis

This commit is contained in:
Valentin Kipyatkov
2016-08-29 00:03:52 +03:00
parent 5c1e42aa51
commit 8bfc746f4b
5 changed files with 16 additions and 8 deletions
@@ -390,6 +390,13 @@ private class Processor(
}
}
is KtSuperTypeListEntry -> {
if (typeRef == typeRefParent.typeReference) {
// usage in super type list - just ignore, inheritors are processed above
return true
}
}
is KtIsExpression -> {
val scopeOfPossibleSmartCast = typeRefParent.getParentOfType<KtDeclarationWithBody>(true)
scopeOfPossibleSmartCast?.let { usePlainSearch(it) }
@@ -10,6 +10,8 @@ data class A(val <caret>n: Int, val s: String, val o: Any) {
}
}
abstract class X : Comparable<A>
fun A.ext1() {
val (x, y) = getThis()
}
@@ -1,5 +1,5 @@
[dataClass.0.kt] Value read 14 val (x, y) = getThis()
[dataClass.0.kt] Value read 22 val (x, y) = get(0)
[dataClass.0.kt] Value read 16 val (x, y) = getThis()
[dataClass.0.kt] Value read 24 val (x, y) = get(0)
[dataClass.1.kt] Function call 6 a.component1()
[dataClass.1.kt] Value read 10 val (x2, y2, z2) = g()
[dataClass.1.kt] Value read 11 val (x3, y3, z3) = h()
@@ -1,15 +1,14 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtFunction
// OPTIONS: usages
open class X
interface X
class Y : X()
class Y : X
operator fun X.component1(): Int = 0
operator fun X.<caret>component2(): Int = 1
fun f() = X()
fun f() = Y()
fun test() {
val (x, y) = f()
@@ -1,2 +1,2 @@
Value read 15 val (x, y) = f()
Value read 19 val (a, b) = this
Value read 14 val (x, y) = f()
Value read 18 val (a, b) = this