From c770225d5f89535ae5651c422c52633473751364 Mon Sep 17 00:00:00 2001 From: Paweł Marks Date: Tue, 11 Feb 2020 15:11:36 +0100 Subject: Fixes infinite recursion in DRI expansion caused by bounds on nullable parameters --- core/src/test/kotlin/basic/DRITest.kt | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 core/src/test/kotlin/basic/DRITest.kt (limited to 'core/src/test/kotlin/basic/DRITest.kt') diff --git a/core/src/test/kotlin/basic/DRITest.kt b/core/src/test/kotlin/basic/DRITest.kt new file mode 100644 index 00000000..f8328e35 --- /dev/null +++ b/core/src/test/kotlin/basic/DRITest.kt @@ -0,0 +1,43 @@ +package basic + +import org.jetbrains.dokka.links.* +import org.junit.Assert.assertEquals +import org.junit.Test +import testApi.testRunner.AbstractCoreTest + +class DRITest: AbstractCoreTest() { + @Test + fun `#634`() { + val configuration = dokkaConfiguration { + passes { + pass { + sourceRoots = listOf("src/") + } + } + } + + testInline( + """ + |/src/main/kotlin/basic/Test.kt + |package toplevel + | + |inline fun > Array.mySortBy( + | crossinline selector: (T) -> R?): Array = TODO() + |} + """.trimMargin(), + configuration + ) { + documentablesMergingStage = { module -> + val expected = TypeConstructor("kotlin.Function1", listOf( + TypeParam(listOf(Nullable(TypeConstructor("kotlin.Any", emptyList())))), + Nullable(TypeParam(listOf(TypeConstructor("kotlin.Comparable", listOf(SelfType))))) + )) + val actual = module.packages.single() + .functions.single() + .dri.callable?.params?.single() + assertEquals(expected, actual) + } + } + } + +} \ No newline at end of file -- cgit