Report incomplete hierarchy error for deserialized types

#KT-5129 Fixed

Delete a JPS test that was specifically testing that we would not fail in this
situation; now there's a compilation error
This commit is contained in:
Alexander Udalov
2015-02-09 17:52:42 +03:00
parent b1d9e5c961
commit 949144e0c0
15 changed files with 118 additions and 82 deletions
@@ -0,0 +1,7 @@
package test
public open class Super {
public fun foo() {}
}
public open class Sub : Super()
@@ -0,0 +1,6 @@
error: supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class test.Sub, unresolved supertypes: test.Super
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInKotlin/source.kt:5:22: error: unresolved reference: foo
fun bar() = SubSub().foo()
^
@@ -0,0 +1,5 @@
import test.Sub
class SubSub : Sub()
fun bar() = SubSub().foo()
@@ -244,6 +244,22 @@ public class CompileKotlinAgainstCustomBinariesTest extends TestCaseWithTmpdir {
JetTestUtils.assertEqualsToFile(new File(getTestDataDirectory(), "output.txt"), output);
}
public void testIncompleteHierarchyInKotlin() throws Exception {
// Analogous to testIncompleteHierarchyInJava, but with a Kotlin library
File library = copyJarFileWithoutEntry(compileLibrary("library"), "test/Super.class");
File source = new File(getTestDataDirectory(), "source.kt");
Pair<String, ExitCode> pair = CliBaseTest.executeCompilerGrabOutput(new K2JVMCompiler(), Arrays.asList(
source.getPath(),
"-classpath", library.getPath(),
"-d", tmpdir.getPath()
));
JetTestUtils.assertEqualsToFile(new File(getTestDataDirectory(), "output.txt"), pair.first);
}
/*test source mapping generation when source info is absent*/
public void testInlineFunWithoutDebugInfo() throws Exception {
File inlineSource = new File(getTestDataDirectory(), "sourceInline.kt");
@@ -265,7 +281,8 @@ public class CompileKotlinAgainstCustomBinariesTest extends TestCaseWithTmpdir {
//skip debug info
}
}, 0);
} finally {
}
finally {
is.close();
}
@@ -299,7 +316,8 @@ public class CompileKotlinAgainstCustomBinariesTest extends TestCaseWithTmpdir {
debugInfo.set(debug);
}
}, 0);
} finally {
}
finally {
resultStream.close();
}
@@ -316,7 +334,8 @@ public class CompileKotlinAgainstCustomBinariesTest extends TestCaseWithTmpdir {
if (InlineCodegenUtil.GENERATE_SMAP) {
assertEquals(expected, debugInfo.get());
} else {
}
else {
assertEquals(null, debugInfo.get());
}
}