Discriminate header classes in favor of non-header type aliases

In the test case, the problem was that Foo.a's type was resolved to the
_class A_, which was written to metadata on JVM instead of the class
AImpl with typealias A as an abbreviation. This metadata was incorrect
because there's no class A from the JVM compiler's point of view; that's
why the error "cannot access class A" was reported

 #KT-19151 Fixed
This commit is contained in:
Alexander Udalov
2017-07-21 00:17:42 +03:00
parent 6ee94dae6f
commit ebdf5aa223
6 changed files with 34 additions and 4 deletions
@@ -155,6 +155,12 @@ public class MultiPlatformIntegrationTestGenerated extends AbstractMultiPlatform
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/multiplatform/implTypeAlias"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
}
@TestMetadata("discriminateHeaderClassInFavorOfTypeAlias")
public void testDiscriminateHeaderClassInFavorOfTypeAlias() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/multiplatform/implTypeAlias/discriminateHeaderClassInFavorOfTypeAlias/");
doTest(fileName);
}
@TestMetadata("generic")
public void testGeneric() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/multiplatform/implTypeAlias/generic/");