Inspection (and quickfix) for extension propeties conflicting with synthetic ones
This commit is contained in:
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.ConflictingExtensionPropertyInspection
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
|
||||
var Thread.<caret>priority: Int
|
||||
get() = this.getPriority()
|
||||
set(value) {
|
||||
this.setPriority(value)
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
import java.io.File
|
||||
|
||||
class C {
|
||||
val File.<caret>name: String
|
||||
get() = getName()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
import java.io.File
|
||||
|
||||
class C {
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
package test
|
||||
|
||||
fun foo() {
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test
|
||||
|
||||
import java.io.File
|
||||
import utils.*
|
||||
|
||||
fun foo(file: File) {
|
||||
print(file.name)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
import java.io.File
|
||||
|
||||
fun foo(file: File) {
|
||||
print(file.name)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
package utils
|
||||
|
||||
import java.io.File
|
||||
|
||||
// WITH_RUNTIME
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
package test
|
||||
|
||||
import utils.name
|
||||
|
||||
fun foo() {
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
package utils
|
||||
|
||||
import java.io.File
|
||||
|
||||
val File.<caret>name: String
|
||||
get() = getName()
|
||||
|
||||
// WITH_RUNTIME
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test
|
||||
|
||||
import java.io.File
|
||||
import utils.*
|
||||
|
||||
fun foo(file: File) {
|
||||
print(file.name)
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package test
|
||||
|
||||
import java.io.File
|
||||
import utils.name
|
||||
|
||||
fun foo(file: File) {
|
||||
print(file.name)
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
import java.io.File
|
||||
import utils.name
|
||||
|
||||
fun foo(file: File, thread: Thread) {
|
||||
print(file.name)
|
||||
print(thread.name)
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
package utils
|
||||
|
||||
import java.io.File
|
||||
|
||||
val Thread.name: String
|
||||
get() = getName()
|
||||
|
||||
// WITH_RUNTIME
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
package utils
|
||||
|
||||
import java.io.File
|
||||
|
||||
val File.<caret>name: String
|
||||
get() = getName()
|
||||
|
||||
val Thread.name: String
|
||||
get() = getName()
|
||||
|
||||
// WITH_RUNTIME
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
import java.io.File
|
||||
import utils.name
|
||||
|
||||
fun foo(file: File, thread: Thread) {
|
||||
print(file.name)
|
||||
print(thread.name)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
import java.io.File
|
||||
|
||||
val File.<caret>name: String
|
||||
get() { return getName() }
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
import java.io.File
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
import java.io.File
|
||||
|
||||
val File.<caret>name: String
|
||||
get() = getName()
|
||||
@@ -0,0 +1,3 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
import java.io.File
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
|
||||
val Thread.<caret>priority: Int
|
||||
get() = getPriority()
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Delete redundant extension property" "false"
|
||||
import java.io.File
|
||||
|
||||
var File.<caret>name: String
|
||||
get() = getName()
|
||||
set(value) {}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
|
||||
var Thread.<caret>priority: Int
|
||||
get() = getPriority()
|
||||
set(value) {
|
||||
setPriority(value)
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
// "Delete redundant extension property" "true"
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Delete redundant extension property" "false"
|
||||
// ACTION: Convert property to function
|
||||
|
||||
class C : Thread() {
|
||||
val Thread.<caret>priority: Int
|
||||
get() = this@C.getPriority()
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Delete redundant extension property" "false"
|
||||
|
||||
class C : Thread() {
|
||||
var Thread.<caret>priority: Int
|
||||
get() = getPriority()
|
||||
set(value) {
|
||||
this@C.setPriority(value)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Delete redundant extension property" "false"
|
||||
|
||||
var Thread.<caret>priority: Int
|
||||
get() = getPriority() + 1
|
||||
set(value) {
|
||||
setPriority(value)
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Delete redundant extension property" "false"
|
||||
// ACTION: Convert property to function
|
||||
import java.io.File
|
||||
|
||||
public val File.<caret>parent: File?
|
||||
get() = getParentFile()
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Delete redundant extension property" "false"
|
||||
|
||||
var Thread.<caret>priority: Int
|
||||
get() = this.getPriority()
|
||||
set(value) {
|
||||
this.setPriority(value)
|
||||
System.out.print("set")
|
||||
}
|
||||
Reference in New Issue
Block a user