[KLIB] Fix references to private top-level typealias via type abbreviation
This commit is contained in:
+4
@@ -58,6 +58,10 @@ abstract class KotlinManglerImpl : KotlinMangler {
|
|||||||
|
|
||||||
if (declaration.isPlatformSpecificExported()) return true
|
if (declaration.isPlatformSpecificExported()) return true
|
||||||
|
|
||||||
|
if (declaration is IrTypeAlias && declaration.parent is IrPackageFragment) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
if (descriptorAnnotations.hasAnnotation(publishedApiAnnotation)) {
|
if (descriptorAnnotations.hasAnnotation(publishedApiAnnotation)) {
|
||||||
return true
|
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()
|
||||||
+5
@@ -25131,6 +25131,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");
|
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")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/typealias/simple.kt");
|
runTest("compiler/testData/codegen/box/typealias/simple.kt");
|
||||||
|
|||||||
+5
@@ -25131,6 +25131,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");
|
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")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/typealias/simple.kt");
|
runTest("compiler/testData/codegen/box/typealias/simple.kt");
|
||||||
|
|||||||
+5
@@ -24031,6 +24031,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");
|
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")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/typealias/simple.kt");
|
runTest("compiler/testData/codegen/box/typealias/simple.kt");
|
||||||
|
|||||||
Generated
+5
@@ -19181,6 +19181,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");
|
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")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/typealias/simple.kt");
|
runTest("compiler/testData/codegen/box/typealias/simple.kt");
|
||||||
|
|||||||
+5
@@ -20336,6 +20336,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");
|
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")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/typealias/simple.kt");
|
runTest("compiler/testData/codegen/box/typealias/simple.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user