[Commonizer] Adapt CirUnderscoredTypeAliasSubstitutorTest
^KT-48288
This commit is contained in:
committed by
Space
parent
9d2553bd18
commit
e2343094ec
+1
@@ -125,6 +125,7 @@ internal class ClassOrTypeAliasTypeCommonizer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (candidates.isEmpty()) return null
|
if (candidates.isEmpty()) return null
|
||||||
|
if (candidates.size == 1) return candidates.first()
|
||||||
|
|
||||||
return candidates.maxByOrNull { candidate -> types.count { it.classifierId == candidate } }!!
|
return candidates.maxByOrNull { candidate -> types.count { it.classifierId == candidate } }!!
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.commonizer.transformer
|
|||||||
import org.jetbrains.kotlin.commonizer.AbstractInlineSourcesCommonizationTest
|
import org.jetbrains.kotlin.commonizer.AbstractInlineSourcesCommonizationTest
|
||||||
import org.jetbrains.kotlin.commonizer.assertCommonized
|
import org.jetbrains.kotlin.commonizer.assertCommonized
|
||||||
|
|
||||||
class UnderscoredTypeAliasTypeSubstitutorTest : AbstractInlineSourcesCommonizationTest() {
|
class UnderscoredTypeAliasTypeSubstitutonTest : AbstractInlineSourcesCommonizationTest() {
|
||||||
|
|
||||||
fun `test inlined underscored typealias - single platform`() {
|
fun `test inlined underscored typealias - single platform`() {
|
||||||
val result = commonize {
|
val result = commonize {
|
||||||
@@ -61,7 +61,8 @@ class UnderscoredTypeAliasTypeSubstitutorTest : AbstractInlineSourcesCommonizati
|
|||||||
"(a, b)", """
|
"(a, b)", """
|
||||||
typealias X = Int
|
typealias X = Int
|
||||||
typealias __X = X
|
typealias __X = X
|
||||||
expect fun x(x: X)
|
/* No hard requirement. Picking X over __X seems equally fine here */
|
||||||
|
expect fun x(x: __X)
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user