[FIR] Properly set isOperator flag for java functions

^KT-56875 Fixed
This commit is contained in:
Dmitriy Novozhilov
2023-02-22 16:34:39 +02:00
committed by Space Team
parent df47581c5a
commit 244dbb37cf
21 changed files with 368 additions and 256 deletions
@@ -0,0 +1,20 @@
FILE: main.kt
public final operator fun R|Base|.plus(s: R|kotlin/String|): R|kotlin/Int| {
^plus Int(0)
}
public final class Derived : R|Base| {
public constructor(): R|Derived| {
super<R|Base|>()
}
public final fun test_1(x: R|Base|): R|kotlin/Unit| {
lval y: R|kotlin/Int| = R|<local>/x|.R|/plus|(String())
R|<local>/y|.R|kotlin/Int.inc|()
}
public final fun test_2(x: R|Base|): R|kotlin/Unit| {
lval y: R|kotlin/String!| = R|<local>/x|.R|/Base.plus|(vararg(String()))
R|<local>/y|.R|kotlin/String.length|
}
}
@@ -0,0 +1,22 @@
// ISSUE: KT-56875
// FILE: Base.java
public class Base {
public String plus(String... strings) { // (1)
return "";
}
}
// FILE: main.kt
operator fun Base.plus(s: String): Int = 0 // (2)
class Derived : Base() {
fun test_1(x: Base) {
val y = x + "" // should resolve to (2)
y.inc() // should be ok
}
fun test_2(x: Base) {
val y = x.plus("") // should resolve to (1)
y.length // should be ok
}
}