KT-62676 [AA] Collect redundant this qualifiers in reference shortener
^KT-62676 Fixed
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
class Foo
|
||||
|
||||
fun Foo.one() {}
|
||||
|
||||
fun Foo.usage() {
|
||||
<expr>this.one()</expr>
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
Before shortening: this.one()
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] this.one()
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] this.one()
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] this.one()
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package test
|
||||
|
||||
class Foo
|
||||
|
||||
fun Foo.one() {}
|
||||
|
||||
fun Foo.usage() {
|
||||
fun one() {}
|
||||
|
||||
<expr>this.one()</expr>
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
Before shortening: this.one()
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
class Foo {
|
||||
fun one() {}
|
||||
|
||||
fun usage() {
|
||||
<expr>this.one()</expr>
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
Before shortening: this.one()
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] this.one()
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] this.one()
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] this.one()
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package test
|
||||
|
||||
class Foo {
|
||||
fun one() {}
|
||||
|
||||
fun usage() {
|
||||
fun one() {}
|
||||
|
||||
<expr>this.one()</expr>
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
Before shortening: this.one()
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
class Foo {
|
||||
val one: Int
|
||||
|
||||
init {
|
||||
<expr>this.one</expr> = 10
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
Before shortening: this.one
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] this.one
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] this.one
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] this.one
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
class Foo(one: Int) {
|
||||
val one: Int
|
||||
|
||||
init {
|
||||
<expr>this.one</expr> = one
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
Before shortening: this.one
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
class Foo {
|
||||
val one: Int = 10
|
||||
|
||||
fun usage() {
|
||||
<expr>this.one</expr>
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
Before shortening: this.one
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] this.one
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] this.one
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] this.one
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
class Foo {
|
||||
val one: Int = 10
|
||||
|
||||
context(Context)
|
||||
fun usage() {
|
||||
<expr>this.one</expr>
|
||||
}
|
||||
}
|
||||
|
||||
class Context {
|
||||
val one: Int = 20
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
Before shortening: this.one
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] this.one
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] this.one
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] this.one
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package test
|
||||
|
||||
class Foo {
|
||||
val one: Int = 10
|
||||
|
||||
fun usage() {
|
||||
val one = 20
|
||||
|
||||
<expr>this.one</expr>
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
Before shortening: this.one
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
class Foo {
|
||||
val one: Int = 10
|
||||
|
||||
fun usage(one: Int) {
|
||||
<expr>this.one</expr>
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
Before shortening: this.one
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package test
|
||||
|
||||
class Foo {
|
||||
val one: Int = 10
|
||||
|
||||
fun usage() {
|
||||
<expr>this.one</expr>
|
||||
|
||||
val one = 20
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
Before shortening: this.one
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] this.one
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] this.one
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] this.one
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
class Foo
|
||||
|
||||
fun Foo?.one() {}
|
||||
|
||||
fun Foo?.usage() {
|
||||
<expr>this.one()</expr>
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
Before shortening: this.one()
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] this.one()
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] this.one()
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] this.one()
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
class Foo
|
||||
|
||||
fun Foo.one() {}
|
||||
|
||||
fun Foo?.usage() {
|
||||
<expr>this?.one()</expr>
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
Before shortening: this?.one()
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
Reference in New Issue
Block a user