ReplaceGetIntention should not be available for non-operator functions
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int, vararg b: Int, c: Int = 0) : Int = 0
|
||||
operator fun get(a: Int, vararg b: Int, c: Int = 0) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test.g<caret>et(1, 3, 4, 5)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int, vararg b: Int, c: Int = 0) : Int = 0
|
||||
operator fun get(a: Int, vararg b: Int, c: Int = 0) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test[1, 3, 4, 5]
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int, b: Int, fn: (i: Int) -> Int) : Int = 0
|
||||
operator fun get(a: Int, b: Int, fn: (i: Int) -> Int) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test.g<caret>et(1, 2) { i ->
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int, b: Int, fn: (i: Int) -> Int) : Int = 0
|
||||
operator fun get(a: Int, b: Int, fn: (i: Int) -> Int) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test[1, 2, { i ->
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
// ERROR: No value passed for parameter b
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int, b: Int) : Int = 0
|
||||
operator fun get(a: Int, b: Int) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test.g<caret>et(a=0, a=1)
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
fun test() {
|
||||
class Test()
|
||||
|
||||
fun Test.get(i: Int) : Int = 0
|
||||
operator fun Test.get(i: Int) : Int = 0
|
||||
|
||||
val test = Test()
|
||||
test.g<caret>et(0)
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
fun test() {
|
||||
class Test()
|
||||
|
||||
fun Test.get(i: Int) : Int = 0
|
||||
operator fun Test.get(i: Int) : Int = 0
|
||||
|
||||
val test = Test()
|
||||
test[0]
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(fn: (i: Int) -> Int) : Int = 0
|
||||
operator fun get(fn: (i: Int) -> Int) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test.g<caret>et() { i ->
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(fn: (i: Int) -> Int) : Int = 0
|
||||
operator fun get(fn: (i: Int) -> Int) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test[{ i ->
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
|
||||
<problem>
|
||||
<file>extensionFunction.kt</file>
|
||||
<line>6</line>
|
||||
<line>7</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/extensionFunction.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// ERROR: Cannot find a parameter with this name: c
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int=1, b: Int=2) : Int = 0
|
||||
operator fun get(a: Int=1, b: Int=2) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test.g<caret>et(c=3)
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int=1, b: Int=2) : Int = 0
|
||||
operator fun get(a: Int=1, b: Int=2) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test.g<caret>et(b=3)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int, b: Int) : Int = 0
|
||||
operator fun get(a: Int, b: Int) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test.g<caret>et(1, 2)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int, b: Int) : Int = 0
|
||||
operator fun get(a: Int, b: Int) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test[1, 2]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get() : Int = 0
|
||||
operator fun get() : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test.g<caret>et()
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// IS_APPLICABLE: false
|
||||
package p
|
||||
|
||||
class C
|
||||
|
||||
fun C.get(s: String) = s
|
||||
|
||||
fun foo(c: C) {
|
||||
c.<caret>get("x")
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
class C {
|
||||
companion object {
|
||||
fun get(s: String): C = C()
|
||||
operator fun get(s: String): C = C()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class C {
|
||||
companion object {
|
||||
fun get(s: String): C = C()
|
||||
operator fun get(s: String): C = C()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// ERROR: Unresolved reference: got
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(i: Int) : Int = 0
|
||||
operator fun get(i: Int) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test.g<caret>ot(0)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(i: Int) : Int = 0
|
||||
operator fun get(i: Int) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test.g<caret>et(0)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(i: Int) : Int = 0
|
||||
operator fun get(i: Int) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test[0]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
open class Base {
|
||||
open fun get(s: String) = ""
|
||||
open operator fun get(s: String) = ""
|
||||
}
|
||||
|
||||
class C : Base() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
package p
|
||||
|
||||
fun get(s: String) = s
|
||||
operator fun get(s: String) = s
|
||||
|
||||
fun foo() {
|
||||
p.<caret>get("x")
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int, vararg b: Int, c: Int = 0) : Int = 0
|
||||
operator fun get(a: Int, vararg b: Int, c: Int = 0) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test.g<caret>et(1, 3, 4, c=5)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int = 0, b: Int = 1, c: Int = 2, d: Int = 3) : Int = 0
|
||||
operator fun get(a: Int = 0, b: Int = 1, c: Int = 2, d: Int = 3) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test.g<caret>et(1, c=3, b=2)
|
||||
|
||||
Reference in New Issue
Block a user