Introduce initial version of FIR Java type enhancement

Java type enhancement is performed by a special scope kind
Java FIR dump was added for multiplatform tests to look at enhancements
Overrides, J2K mapping, special cases does not work yet

Related to KT-29937
This commit is contained in:
Mikhail Glukhikh
2019-02-15 10:36:57 +03:00
parent 060bd1b464
commit f31faafd72
56 changed files with 2042 additions and 336 deletions
@@ -0,0 +1,6 @@
public open class Some : R|java/lang/Object| {
public open operator function foo(param: R|kotlin/Int|): R|kotlin/Boolean|
public open operator function bar(arr: R|kotlin/IntArray|): R|kotlin/Array<ft<java/lang/String, java/lang/String?>>|
}
@@ -0,0 +1,14 @@
public class Some {
public boolean foo(int param) {
return param > 0;
}
public String[] bar(int[] arr) {
String[] result = new String[arr.length];
int i = 0;
for (int elem: arr) {
result[i++] = elem;
}
return result;
}
}
@@ -0,0 +1,7 @@
class A : Some() {
fun test() {
val res1 = foo(1)
val res2 = foo(-1)
val res3 = bar(intArrayOf(0, 2, -2))
}
}
@@ -0,0 +1,11 @@
FILE: jvm.kt
public final class A : R|Some| {
public constructor(): super<R|Some|>()
public final function test(): R|kotlin/Unit| {
val res1: R|error: Not supported: FirImplicitTypeRefImpl| = R|/Some.foo|(Int(1))
val res2: R|error: Not supported: FirImplicitTypeRefImpl| = R|/Some.foo|(<Unresolved name: unaryMinus>#(Int(1)))
val res3: R|error: Not supported: FirImplicitTypeRefImpl| = R|/Some.bar|(<Unresolved name: intArrayOf>#(Int(0), Int(2), <Unresolved name: unaryMinus>#(Int(2))))
}
}