diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-10 16:01:51 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-10 16:01:51 +0100 |
commit | f93ff9c31a815a448b03c3d76d21fd0a6d45c58d (patch) | |
tree | 050a285bbdd6b8f85940a4a7386eb78b90633596 | |
parent | 25592f52ea3e70e183a2a72bc411346b1650ed9a (diff) | |
download | dokka-f93ff9c31a815a448b03c3d76d21fd0a6d45c58d.tar.gz dokka-f93ff9c31a815a448b03c3d76d21fd0a6d45c58d.tar.bz2 dokka-f93ff9c31a815a448b03c3d76d21fd0a6d45c58d.zip |
correctly render bounds of type parameters in declarations
-rw-r--r-- | src/Kotlin/KotlinLanguageService.kt | 2 | ||||
-rw-r--r-- | test/data/format/typeParameterBounds.kt | 6 | ||||
-rw-r--r-- | test/data/format/typeParameterBounds.md | 15 | ||||
-rw-r--r-- | test/src/format/MarkdownFormatTest.kt | 6 | ||||
-rw-r--r-- | test/src/model/FunctionTest.kt | 2 |
5 files changed, 28 insertions, 3 deletions
diff --git a/src/Kotlin/KotlinLanguageService.kt b/src/Kotlin/KotlinLanguageService.kt index 267c0a52..43854381 100644 --- a/src/Kotlin/KotlinLanguageService.kt +++ b/src/Kotlin/KotlinLanguageService.kt @@ -147,7 +147,7 @@ class KotlinLanguageService : LanguageService { if (typeParameters.any()) { symbol("<") renderList(typeParameters) { - renderType(it) + renderTypeParameter(it) } symbol("> ") } diff --git a/test/data/format/typeParameterBounds.kt b/test/data/format/typeParameterBounds.kt new file mode 100644 index 00000000..5f22f8c5 --- /dev/null +++ b/test/data/format/typeParameterBounds.kt @@ -0,0 +1,6 @@ + +/** + * generic function + */ +public fun <T : R, R> generic() { +}
\ No newline at end of file diff --git a/test/data/format/typeParameterBounds.md b/test/data/format/typeParameterBounds.md new file mode 100644 index 00000000..f9d39e8c --- /dev/null +++ b/test/data/format/typeParameterBounds.md @@ -0,0 +1,15 @@ +[test](out.md) / [](out.md) / [generic](out.md) + + +# generic + + +``` +public fun <T : R, R> generic(): Unit +``` + + +generic function + + + diff --git a/test/src/format/MarkdownFormatTest.kt b/test/src/format/MarkdownFormatTest.kt index 77c03ed2..57882c1a 100644 --- a/test/src/format/MarkdownFormatTest.kt +++ b/test/src/format/MarkdownFormatTest.kt @@ -104,4 +104,10 @@ public class MarkdownFormatTest { markdownService.appendNodes(tempLocation, output, model.members.single().members) } } + + Test fun typeParameterBounds() { + verifyOutput("test/data/format/typeParameterBounds.kt", ".md") { model, output -> + markdownService.appendNodes(tempLocation, output, model.members.single().members) + } + } } diff --git a/test/src/model/FunctionTest.kt b/test/src/model/FunctionTest.kt index c648cb55..e40777af 100644 --- a/test/src/model/FunctionTest.kt +++ b/test/src/model/FunctionTest.kt @@ -92,8 +92,6 @@ public class FunctionTest { assertEquals(Content.Empty, content) with(details.single()) { assertEquals("R", name) - assertEquals("R", name) - assertEquals("R", name) assertEquals(DocumentationNode.Kind.UpperBound, kind) assertEquals(Content.Empty, content) assertTrue(details.none()) |