[KLIB] Fix references to private top-level typealias via type abbreviation

This commit is contained in:
Roman Artemev
2019-09-10 19:34:57 +03:00
committed by romanart
parent 40ebe4063c
commit e5a1040dbd
7 changed files with 51 additions and 0 deletions
@@ -58,6 +58,10 @@ abstract class KotlinManglerImpl : KotlinMangler {
if (declaration.isPlatformSpecificExported()) return true
if (declaration is IrTypeAlias && declaration.parent is IrPackageFragment) {
return true
}
if (descriptorAnnotations.hasAnnotation(publishedApiAnnotation)) {
return true
}
@@ -0,0 +1,22 @@
// MODULE: lib
// FILE: f1.kt
private typealias TA = String
public interface I {
public fun foo(): TA
}
open public class B: I {
override fun foo() = "OK"
}
// FILE: f2.kt
public class D: B()
// MODULE: main(lib)
// FILE: m.kt
fun box() = D().foo()
@@ -25131,6 +25131,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");
}
@TestMetadata("privateInKlib.kt")
public void testPrivateInKlib() throws Exception {
runTest("compiler/testData/codegen/box/typealias/privateInKlib.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/typealias/simple.kt");
@@ -25131,6 +25131,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");
}
@TestMetadata("privateInKlib.kt")
public void testPrivateInKlib() throws Exception {
runTest("compiler/testData/codegen/box/typealias/privateInKlib.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/typealias/simple.kt");
@@ -24031,6 +24031,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");
}
@TestMetadata("privateInKlib.kt")
public void testPrivateInKlib() throws Exception {
runTest("compiler/testData/codegen/box/typealias/privateInKlib.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/typealias/simple.kt");
@@ -19181,6 +19181,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");
}
@TestMetadata("privateInKlib.kt")
public void testPrivateInKlib() throws Exception {
runTest("compiler/testData/codegen/box/typealias/privateInKlib.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/typealias/simple.kt");
@@ -20336,6 +20336,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");
}
@TestMetadata("privateInKlib.kt")
public void testPrivateInKlib() throws Exception {
runTest("compiler/testData/codegen/box/typealias/privateInKlib.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/typealias/simple.kt");