diff options
author | Vadim Mishenev <vad-mishenev@yandex.ru> | 2022-04-29 12:04:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-29 12:04:58 +0300 |
commit | 84aacad29982240ae367b21e9d283d38dab672ae (patch) | |
tree | 7241d83af629ccc16a6bb0d8adeaf922813156e0 /plugins/base/src/test/kotlin | |
parent | 4451b8e546584da389da60f73b56ce25d6ac2eaa (diff) | |
download | dokka-84aacad29982240ae367b21e9d283d38dab672ae.tar.gz dokka-84aacad29982240ae367b21e9d283d38dab672ae.tar.bz2 dokka-84aacad29982240ae367b21e9d283d38dab672ae.zip |
Fix arg name inside functional type (#2478)
Diffstat (limited to 'plugins/base/src/test/kotlin')
-rw-r--r-- | plugins/base/src/test/kotlin/signatures/FunctionalTypeConstructorsSignatureTest.kt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/base/src/test/kotlin/signatures/FunctionalTypeConstructorsSignatureTest.kt b/plugins/base/src/test/kotlin/signatures/FunctionalTypeConstructorsSignatureTest.kt index cd55a001..1e0a5404 100644 --- a/plugins/base/src/test/kotlin/signatures/FunctionalTypeConstructorsSignatureTest.kt +++ b/plugins/base/src/test/kotlin/signatures/FunctionalTypeConstructorsSignatureTest.kt @@ -108,6 +108,31 @@ class FunctionalTypeConstructorsSignatureTest : BaseAbstractTest() { } } + @Test + fun `kotlin syntactic sugar function with param name of generic and functional type`() { + val source = source(""" + | @Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.TYPE) + | @MustBeDocumented + | annotation class Fancy + | + | fun <T> f(): (param1: T, param2: @Fancy ()->Unit) -> String " + """.trimIndent()) + val writerPlugin = TestOutputWriterPlugin() + + testInline( + source, configuration, pluginOverrides = listOf(writerPlugin) + ) { + renderingStage = { _, _ -> + writerPlugin.writer.renderedContent("root/example/index.html").lastSignature().match( + "fun <", A("T"), "> ", + A("f"), "(): (param1:", A("T"), + ", param2: ", Span("@", A("Fancy")), " () -> ", A("Unit"), + ") -> ", A("String"), Span(), + ignoreSpanWithTokenStyle = true + ) + } + } + } @Disabled // Add coroutines on classpath and get proper import @Test fun `kotlin normal suspendable function`() { |