Skip to content

Commit

Permalink
Fix KT-68341
Browse files Browse the repository at this point in the history
  • Loading branch information
vmishenev committed Jun 18, 2024
1 parent ab507fe commit a40d825
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ internal class TypeTranslator(
fun KaSession.toBoundFrom(type: KaType): Bound =
when (type) {
is KaUsualClassType -> {
if (type.symbol is KaTypeAliasSymbol) toBoundFromTypeAliased(type)
// after KT-66996, [type] is an expanded type
val abbreviatedType = type.abbreviatedType
if (abbreviatedType != null) toBoundFromTypeAliased(abbreviatedType)
else toTypeConstructorFrom(type)
}

Expand All @@ -89,8 +91,10 @@ internal class TypeTranslator(

is KaClassErrorType -> UnresolvedBound(type.toString())
is KaFunctionalType -> {
if (type.symbol is KaTypeAliasSymbol) toBoundFromTypeAliased(type)
else toFunctionalTypeConstructorFrom(type)
// after KT-66996, [type] is an expanded type
val abbreviatedType = type.abbreviatedType
if (abbreviatedType != null) toBoundFromTypeAliased(abbreviatedType)
else toTypeConstructorFrom(type)
}
is KaDynamicType -> Dynamic
is KaDefinitelyNotNullType -> DefinitelyNonNullable(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import org.jetbrains.dokka.base.signatures.KotlinSignatureUtils.driOrNull
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.*
import utils.AbstractModelTest
import utils.OnlyDescriptors
import kotlin.test.Test
import kotlin.test.assertTrue

class TypesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "types") {

@Test
@OnlyDescriptors("#3649")
fun `type with typealias to functional type with parameter`() {
inlineModelTest(
"""
Expand Down Expand Up @@ -42,6 +44,7 @@ class TypesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "types")
}

@Test
@OnlyDescriptors("#3649")
fun `type with typealias to functional type`() {
inlineModelTest(
"""
Expand Down

0 comments on commit a40d825

Please sign in to comment.