[FIR] Mark more calls origin as OPERATOR
This commit is contained in:
committed by
TeamCityServer
parent
0a45b3a50b
commit
07a8ae7e71
+10
-10
@@ -53,10 +53,10 @@ fun test() {
|
||||
|
||||
a <!OPERATOR_MODIFIER_REQUIRED!>+<!> b
|
||||
a - b
|
||||
a[1]
|
||||
<!OPERATOR_MODIFIER_REQUIRED!>a[1]<!>
|
||||
a["str"]
|
||||
|
||||
a[1] = "A"
|
||||
<!OPERATOR_MODIFIER_REQUIRED!>a[1]<!> = "A"
|
||||
a["str"] = "str"
|
||||
|
||||
a.plus(b)
|
||||
@@ -73,25 +73,25 @@ fun test() {
|
||||
Example()<!OPERATOR_MODIFIER_REQUIRED!>..<!>Example()
|
||||
Example2()..Example2()
|
||||
|
||||
a < b
|
||||
a >= b
|
||||
a <!OPERATOR_MODIFIER_REQUIRED!><<!> b
|
||||
a <!OPERATOR_MODIFIER_REQUIRED!>>=<!> b
|
||||
c > d
|
||||
|
||||
a in b
|
||||
a <!OPERATOR_MODIFIER_REQUIRED!>in<!> b
|
||||
c in d
|
||||
|
||||
a++
|
||||
a--
|
||||
a<!OPERATOR_MODIFIER_REQUIRED!>++<!>
|
||||
a<!OPERATOR_MODIFIER_REQUIRED!>--<!>
|
||||
c++
|
||||
c--
|
||||
|
||||
!a
|
||||
<!OPERATOR_MODIFIER_REQUIRED!>!<!>a
|
||||
!c
|
||||
|
||||
a()
|
||||
<!OPERATOR_MODIFIER_REQUIRED!>a<!>()
|
||||
c()
|
||||
|
||||
Example()()
|
||||
<!OPERATOR_MODIFIER_REQUIRED!>Example()()<!>
|
||||
Example2()()
|
||||
}
|
||||
|
||||
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
import kotlin.reflect.KProperty0
|
||||
|
||||
val a: Int by A()
|
||||
|
||||
class A {
|
||||
fun getValue(t: Any?, p: KProperty0<*>): Int = 1
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlin.reflect.KProperty0
|
||||
|
||||
val a: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!>A()<!>
|
||||
|
||||
+1
-1
@@ -13,6 +13,6 @@ fun String.provideDelegate(a: Any?, p: KProperty<*>) = StringDelegate(this)
|
||||
operator fun String.getValue(a: Any?, p: KProperty<*>) = this
|
||||
|
||||
val test1: String by "OK"
|
||||
val test2: Int by "OK"
|
||||
val test2: Int by <!DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH!>"OK"<!>
|
||||
val test3 by "OK"
|
||||
|
||||
|
||||
Vendored
+2
-1
@@ -99,7 +99,8 @@ public class A extends AImpl implements List<String> {
|
||||
|
||||
fun main() {
|
||||
val x = X()
|
||||
x[0]
|
||||
//todo get only one candidate - AImpl.get, no kotlin.collection.List for some reason
|
||||
<!OPERATOR_MODIFIER_REQUIRED!>x[0]<!>
|
||||
x.size
|
||||
x.remove("")
|
||||
x.remove(1)
|
||||
|
||||
@@ -28,18 +28,18 @@ fun test() {
|
||||
var a = Example()
|
||||
val b = Example()
|
||||
|
||||
consumeString(<!ARGUMENT_TYPE_MISMATCH!>a()<!>)
|
||||
consumeString(<!ARGUMENT_TYPE_MISMATCH!>a[1]<!>)
|
||||
consumeString(a())
|
||||
consumeString(a[1])
|
||||
|
||||
val (x, y) = Example()
|
||||
consumeString(<!ARGUMENT_TYPE_MISMATCH!>x<!>)
|
||||
consumeString(<!ARGUMENT_TYPE_MISMATCH!>y<!>)
|
||||
|
||||
consumeExample2(<!ARGUMENT_TYPE_MISMATCH!>++a<!>)
|
||||
consumeExample2(++a)
|
||||
|
||||
consumeString(a plus b)
|
||||
}
|
||||
|
||||
fun consumeInt(i: Int) {}
|
||||
fun consumeString(s: String) {}
|
||||
fun consumeExample2(e: Example2) {}
|
||||
fun consumeExample2(e: Example2) {}
|
||||
|
||||
@@ -7,7 +7,9 @@ class A {
|
||||
|
||||
fun main() {
|
||||
val a = A()
|
||||
a[1]++
|
||||
a[1] += 3
|
||||
a[1] = a[1] + 3
|
||||
<!OPERATOR_MODIFIER_REQUIRED!>a[1]<!>++
|
||||
//fir prefers plusAssign call if neither get+set nor plusAssign resolverd
|
||||
//hence UNRESOLVED_REFERENCE here
|
||||
a[1] <!UNRESOLVED_REFERENCE!>+=<!> 3
|
||||
<!OPERATOR_MODIFIER_REQUIRED!>a[1]<!> = a[1] + 3
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// FILE: a.kt
|
||||
|
||||
package foo
|
||||
|
||||
operator fun Int.invoke() = null
|
||||
fun Int.foo() = null
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
package bar
|
||||
|
||||
import foo.foo as invoke
|
||||
import foo.invoke
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY!>42<!>()
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// FILE: a.kt
|
||||
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ fun Int.invoke(i: Int, a: Any) {}
|
||||
fun Int.invoke(a: Any, i: Int) {}
|
||||
|
||||
fun foo(i: Int) {
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY!>i<!>(1, 1)
|
||||
<!NONE_APPLICABLE!>i<!>(1, 1)
|
||||
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY!>5<!>(1, 2)
|
||||
<!NONE_APPLICABLE!>5<!>(1, 2)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user