mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-16 08:31:29 +00:00
this@ClassName supported
This commit is contained in:
@@ -257,6 +257,12 @@ private class Processor(
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
is KtContainerNode -> {
|
||||
if (parent.node.elementType == KtNodeTypes.LABEL_QUALIFIER) {
|
||||
return true // this@ClassName - it will be handled anyway because members and extensions are processed with plain search
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (element.getStrictParentOfType<KtImportDirective>() != null) return true // ignore usage in import
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// OPTIONS: usages
|
||||
package pack
|
||||
|
||||
data class A(val <caret>n: Int, val s: String, val o: Any)
|
||||
data class A(val <caret>n: Int, val s: String, val o: Any) {
|
||||
fun f() {
|
||||
"a".apply {
|
||||
this@A.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun A.ext1() {
|
||||
val (x, y) = getThis()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[dataClass.0.kt] Value read 16 val (x, y) = get(0)
|
||||
[dataClass.0.kt] Value read 8 val (x, y) = getThis()
|
||||
[dataClass.0.kt] Value read 14 val (x, y) = getThis()
|
||||
[dataClass.0.kt] Value read 22 val (x, y) = get(0)
|
||||
[dataClass.1.kt] Value read 4 for ((x, y, z) in arrayOf<A>()) {
|
||||
[dataClass.1.kt] Value read 8 val (x, y) = a
|
||||
[dataClass.2.kt] Function call 6 a.component1()
|
||||
|
||||
Reference in New Issue
Block a user