Add inspections for implicit and explicit 'this' #KT-4580 Fixed
This commit is contained in:
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.ImplicitThisInspection
|
||||
@@ -0,0 +1,7 @@
|
||||
class Foo {
|
||||
fun s() = ""
|
||||
|
||||
fun test() {
|
||||
<caret>s()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class Foo {
|
||||
fun s() = ""
|
||||
|
||||
fun test() {
|
||||
<caret>this.s()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// PROBLEM: none
|
||||
|
||||
class Foo {
|
||||
fun s() = ""
|
||||
|
||||
fun test() {
|
||||
<caret>this.s()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class Foo {
|
||||
fun Bar.s() = ""
|
||||
}
|
||||
|
||||
class Bar
|
||||
|
||||
fun test() {
|
||||
Bar().apply {
|
||||
Foo().apply apply2@ {
|
||||
<caret>s()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class Foo {
|
||||
fun Bar.s() = ""
|
||||
}
|
||||
|
||||
class Bar
|
||||
|
||||
fun test() {
|
||||
Bar().apply {
|
||||
Foo().apply apply2@ {
|
||||
<caret>this@apply.s()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class Foo {
|
||||
fun s() = ""
|
||||
|
||||
fun test() {
|
||||
"".apply {
|
||||
<caret>s()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class Foo {
|
||||
fun s() = ""
|
||||
|
||||
fun test() {
|
||||
"".apply {
|
||||
<caret>this@Foo.s()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Foo {
|
||||
val f = Foo()
|
||||
val s = ""
|
||||
|
||||
fun test() {
|
||||
<caret>f.s
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Foo {
|
||||
val f = Foo()
|
||||
val s = ""
|
||||
|
||||
fun test() {
|
||||
<caret>this.f.s
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class Foo {
|
||||
val s = ""
|
||||
|
||||
fun test() {
|
||||
<caret>s
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class Foo {
|
||||
val s = ""
|
||||
|
||||
fun test() {
|
||||
<caret>this.s
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// PROBLEM: none
|
||||
|
||||
class Foo {
|
||||
val s = ""
|
||||
|
||||
fun test() {
|
||||
<caret>this.s
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// PROBLEM: none
|
||||
|
||||
class Foo {
|
||||
fun test() {
|
||||
<caret>s()
|
||||
}
|
||||
}
|
||||
|
||||
fun s() = ""
|
||||
Reference in New Issue
Block a user