New J2K: always print real fqNames for static calls

As fqNames of some symbols may change during conversion
E.g, when moving Java static method to Kotlin companion object

#KT-19607 fixed
#KT-32903 fixed
#KT-33743 fixed
#KT-33556 fixed
This commit is contained in:
Ilya Kirillov
2019-09-24 12:00:51 +03:00
parent f9fac0acf5
commit 704b3bd2e6
20 changed files with 258 additions and 98 deletions
@@ -0,0 +1,4 @@
@file:JvmName("Bar")
package p
fun bar() {}
fun bar(x:Int) {}
+7
View File
@@ -0,0 +1,7 @@
import static p.Bar.bar;
class Impl {
void foo() {
bar();
}
}
+7
View File
@@ -0,0 +1,7 @@
import p.bar
internal class Impl {
fun foo() {
bar()
}
}
@@ -0,0 +1,12 @@
public class Rectangle {
public static int x = 0;
public int y;
}
public class Main {
public static void main(String[] args) {
Rectangle rectangle = new Rectangle();
rectangle.x = 1;
rectangle.y = 2;
}
}
@@ -0,0 +1,16 @@
class Rectangle {
var y = 0
companion object {
var x = 0
}
}
object Main {
@JvmStatic
fun main(args: Array<String>) {
val rectangle = Rectangle()
Rectangle.x = 1
rectangle.y = 2
}
}
@@ -0,0 +1,13 @@
public class Base {
public static void foo() {
}
}
public class Derived extends Base {
}
public class User {
public static void test() {
Derived.foo();
}
}
@@ -0,0 +1,12 @@
open class Base {
companion object {
fun foo() {}
}
}
class Derived : Base()
object User {
fun test() {
Base.foo()
}
}