From 6d17e4da57650cd9b4c426d1caeabc3e4bacccc3 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Tue, 21 Sep 2021 15:23:58 +0200 Subject: [PATCH] [Commonizer] Implement disabled tests for ^KT-48288 ^KT-48288 ^KT-48850 --- .../ParameterizedTypesCommonizationTest.kt | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/native/commonizer/tests/org/jetbrains/kotlin/commonizer/hierarchical/ParameterizedTypesCommonizationTest.kt b/native/commonizer/tests/org/jetbrains/kotlin/commonizer/hierarchical/ParameterizedTypesCommonizationTest.kt index 203de31cf89..82e02656417 100644 --- a/native/commonizer/tests/org/jetbrains/kotlin/commonizer/hierarchical/ParameterizedTypesCommonizationTest.kt +++ b/native/commonizer/tests/org/jetbrains/kotlin/commonizer/hierarchical/ParameterizedTypesCommonizationTest.kt @@ -462,4 +462,66 @@ class ParameterizedTypesCommonizationTest : AbstractInlineSourcesCommonizationTe """.trimIndent() ) } + + @Suppress("unused") // https://youtrack.jetbrains.com/issue/KT-48850 + fun `KT-48850 - test non-commonizable type alias arguments - 0`() { + val result = commonize { + outputTarget("(a, b)") + + simpleSingleSourceTarget( + "a", """ + class Foo + typealias X = Foo + fun x(x: X) + """.trimIndent() + ) + + simpleSingleSourceTarget( + "b", """ + class Foo + typealias X = Foo + fun x(x: X) + """.trimIndent() + ) + } + + result.assertCommonized( + "(a, b)", """ + expect class Foo() + expect fun x(x: Foo) + """.trimIndent() + ) + } + + @Suppress("unused") // https://youtrack.jetbrains.com/issue/KT-48850 + fun `KT-48850 - test non-commonizable type alias arguments - 1`() { + val result = commonize { + outputTarget("(a, b)") + + simpleSingleSourceTarget( + "a", """ + class Foo + typealias X = Foo + typealias Y = X + fun x(x: Y) + """.trimIndent() + ) + + simpleSingleSourceTarget( + "b", """ + class Foo + typealias X = Foo + typealias Y = X + fun x(x: Y) + """.trimIndent() + ) + } + + result.assertCommonized( + "(a, b)", """ + expect class Foo() + expect fun x(x: Foo) + """.trimIndent() + ) + } }