Fix searching serialized classes package contains multiple fragments

This commit is contained in:
Alexey Tsvetkov
2017-07-20 11:21:02 +03:00
parent b54414d628
commit 1c4ada2008
12 changed files with 98 additions and 11 deletions
@@ -3497,6 +3497,12 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
doTest(fileName);
}
@TestMetadata("classReferencingClass.kt")
public void testClassReferencingClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/incremental/classReferencingClass.kt");
doTest(fileName);
}
@TestMetadata("coroutines.kt")
public void testCoroutines() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/incremental/coroutines.kt");
@@ -3515,6 +3521,12 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
doTest(fileName);
}
@TestMetadata("functionReferencingClass.kt")
public void testFunctionReferencingClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/incremental/functionReferencingClass.kt");
doTest(fileName);
}
@TestMetadata("inline.kt")
public void testInline() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/incremental/inline.kt");
@@ -0,0 +1,25 @@
// EXPECTED_REACHABLE_NODES: 1002
// FILE: A.kt
open class A {
open fun f(): Int = 1
}
// FILE: B.kt
// RECOMPILE
class B : A() {
override fun f(): Int = super.f() + 2
}
// FILE: box.kt
fun box(): String {
val af = A().f()
if (af != 1) return "fail: result of 'A().f()' is '$af', but '1' was expected"
val bf = B().f()
if (bf != 3) return "fail: result of 'B().f()' is '$bf', but '3' was expected"
return "OK"
}
@@ -0,0 +1,21 @@
// EXPECTED_REACHABLE_NODES: 995
// FILE: A.kt
open class A {
open fun f(): Int = 1
}
// FILE: useA.kt
// RECOMPILE
fun useA(a: A): Int = a.f()
fun useList(xs: List<Int>) {}
// FILE: box.kt
fun box(): String {
val result = useA(A())
if (result != 1) return "fail: result of 'useA(A())' is '$result', but '1' was expected"
return "OK"
}