diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index e5d9ed623fd..84562679595 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -40636,6 +40636,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/typealias/kt15109.kt"); } + @Test + @TestMetadata("kt45308.kt") + public void testKt45308() throws Exception { + runTest("compiler/testData/codegen/box/typealias/kt45308.kt"); + } + @Test @TestMetadata("objectLiteralConstructor.kt") public void testObjectLiteralConstructor() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java index 484eaf352b3..47dbfbc36d9 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java @@ -440,6 +440,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/declarations/kt35550.kt"); } + @Test + @TestMetadata("kt45308.kt") + public void testKt45308() throws Exception { + runTest("compiler/testData/ir/irText/declarations/kt45308.kt"); + } + @Test @TestMetadata("localClassWithOverrides.kt") public void testLocalClassWithOverrides() throws Exception { diff --git a/compiler/testData/codegen/box/typealias/kt45308.kt b/compiler/testData/codegen/box/typealias/kt45308.kt new file mode 100644 index 00000000000..d3615783783 --- /dev/null +++ b/compiler/testData/codegen/box/typealias/kt45308.kt @@ -0,0 +1,19 @@ +// MODULE: a +// FILE: a.kt +package a + +typealias A = String + +// MODULE: b(a) +// FILE: b.kt +package b + +import a.A + +fun foo(f: () -> A): A = f() + +// MODULE: main(b) +// FILE: c.kt +import b.foo + +fun box(): String = foo { "OK" } diff --git a/compiler/testData/ir/irText/declarations/kt45308.fir.txt b/compiler/testData/ir/irText/declarations/kt45308.fir.txt new file mode 100644 index 00000000000..22f46f1e169 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt45308.fir.txt @@ -0,0 +1,22 @@ +Module: a +FILE fqName:a fileName:/a.kt + TYPEALIAS name:A visibility:public expandedType:kotlin.String +Module: b +FILE fqName:b fileName:/b.kt + FUN name:foo visibility:public modality:FINAL <> (f:kotlin.Function0) returnType:kotlin.String + VALUE_PARAMETER name:f index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (f: kotlin.Function0): kotlin.String declared in b' + CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.String origin=INVOKE + $this: GET_VAR 'f: kotlin.Function0 declared in b.foo' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION +Module: c +FILE fqName: fileName:/c.kt + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public final fun foo (f: kotlin.Function0): kotlin.String declared in b' type=kotlin.String origin=null + f: FUN_EXPR type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' + CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/declarations/kt45308.kt b/compiler/testData/ir/irText/declarations/kt45308.kt new file mode 100644 index 00000000000..0e759fa1962 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt45308.kt @@ -0,0 +1,20 @@ +// SKIP_KT_DUMP +// MODULE: a +// FILE: a.kt +package a + +typealias A = String + +// MODULE: b(a) +// FILE: b.kt +package b + +import a.A + +fun foo(f: () -> A): A = f() + +// MODULE: c(b) +// FILE: c.kt +import b.foo + +fun box(): String = foo { "OK" } diff --git a/compiler/testData/ir/irText/declarations/kt45308.txt b/compiler/testData/ir/irText/declarations/kt45308.txt new file mode 100644 index 00000000000..a42895e40f1 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt45308.txt @@ -0,0 +1,22 @@ +Module: a +FILE fqName:a fileName:/a.kt + TYPEALIAS name:A visibility:public expandedType:kotlin.String +Module: b +FILE fqName:b fileName:/b.kt + FUN name:foo visibility:public modality:FINAL <> (f:kotlin.Function0) returnType:kotlin.String{ a.A } + VALUE_PARAMETER name:f index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (f: kotlin.Function0): kotlin.String{ a.A } declared in b' + CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.String{ a.A } origin=INVOKE + $this: GET_VAR 'f: kotlin.Function0 declared in b.foo' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION +Module: c +FILE fqName: fileName:/c.kt + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public final fun foo (f: kotlin.Function0): kotlin.String{ a.A } declared in b' type=kotlin.String{ a.A } origin=null + f: FUN_EXPR type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String{ a.A } + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String{ a.A } declared in .box' + CONST String type=kotlin.String value="OK" diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 312225903c1..f6d5e29781e 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -40612,6 +40612,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/typealias/kt15109.kt"); } + @Test + @TestMetadata("kt45308.kt") + public void testKt45308() throws Exception { + runTest("compiler/testData/codegen/box/typealias/kt45308.kt"); + } + @Test @TestMetadata("objectLiteralConstructor.kt") public void testObjectLiteralConstructor() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index b8dcf997b47..bf9a539406d 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -40636,6 +40636,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/typealias/kt15109.kt"); } + @Test + @TestMetadata("kt45308.kt") + public void testKt45308() throws Exception { + runTest("compiler/testData/codegen/box/typealias/kt45308.kt"); + } + @Test @TestMetadata("objectLiteralConstructor.kt") public void testObjectLiteralConstructor() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java index 9f09a0771a0..6ee465b08f1 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java @@ -440,6 +440,12 @@ public class IrTextTestGenerated extends AbstractIrTextTest { runTest("compiler/testData/ir/irText/declarations/kt35550.kt"); } + @Test + @TestMetadata("kt45308.kt") + public void testKt45308() throws Exception { + runTest("compiler/testData/ir/irText/declarations/kt45308.kt"); + } + @Test @TestMetadata("localClassWithOverrides.kt") public void testLocalClassWithOverrides() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index aecaff6d284..3ff6095eed1 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -32620,6 +32620,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/typealias/kt15109.kt"); } + @TestMetadata("kt45308.kt") + public void testKt45308() throws Exception { + runTest("compiler/testData/codegen/box/typealias/kt45308.kt"); + } + @TestMetadata("objectLiteralConstructor.kt") public void testObjectLiteralConstructor() throws Exception { runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 173c9ba5659..c1d1eec6128 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -27375,6 +27375,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/typealias/kt15109.kt"); } + @TestMetadata("kt45308.kt") + public void testKt45308() throws Exception { + runTest("compiler/testData/codegen/box/typealias/kt45308.kt"); + } + @TestMetadata("objectLiteralConstructor.kt") public void testObjectLiteralConstructor() throws Exception { runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index fdf62ec6284..bb48df6d256 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -26786,6 +26786,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/typealias/kt15109.kt"); } + @TestMetadata("kt45308.kt") + public void testKt45308() throws Exception { + runTest("compiler/testData/codegen/box/typealias/kt45308.kt"); + } + @TestMetadata("objectLiteralConstructor.kt") public void testObjectLiteralConstructor() throws Exception { runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index c9d47fdc06b..be3a1b9c1e0 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -26746,6 +26746,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/typealias/kt15109.kt"); } + @TestMetadata("kt45308.kt") + public void testKt45308() throws Exception { + runTest("compiler/testData/codegen/box/typealias/kt45308.kt"); + } + @TestMetadata("objectLiteralConstructor.kt") public void testObjectLiteralConstructor() throws Exception { runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index 81d2a95050f..c0e431ff193 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -15044,6 +15044,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/typealias/kt15109.kt"); } + @TestMetadata("kt45308.kt") + public void testKt45308() throws Exception { + runTest("compiler/testData/codegen/box/typealias/kt45308.kt"); + } + @TestMetadata("objectLiteralConstructor.kt") public void testObjectLiteralConstructor() throws Exception { runTest("compiler/testData/codegen/box/typealias/objectLiteralConstructor.kt");