aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-09-09 15:24:51 +0200
committerDmitry Jemerov <yole@jetbrains.com>2015-09-09 15:24:51 +0200
commitcdd7c6b4cf76ee798084af893fb75c46b9c8e5a5 (patch)
tree851a7f5908c6a7a2604f9e363e2a0bfa126831bd
parent2c7e6d87d0c1b71081d528d51cc0cde9b1dbb3e7 (diff)
downloaddokka-cdd7c6b4cf76ee798084af893fb75c46b9c8e5a5.tar.gz
dokka-cdd7c6b4cf76ee798084af893fb75c46b9c8e5a5.tar.bz2
dokka-cdd7c6b4cf76ee798084af893fb75c46b9c8e5a5.zip
don't duplicate 'abstract' and 'sealed' modifiers
-rw-r--r--src/Kotlin/DocumentationBuilder.kt2
-rw-r--r--test/data/classes/sealedClass.kt1
-rw-r--r--test/src/model/ClassTest.kt7
3 files changed, 9 insertions, 1 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index a02717f6..eb603269 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -55,7 +55,7 @@ class DocumentationBuilder(val resolutionFacade: ResolutionFacade,
"kotlin.Float", "kotlin.Double", "kotlin.String", "kotlin.Array", "kotlin.Any")
val knownModifiers = setOf(
JetTokens.PUBLIC_KEYWORD, JetTokens.PROTECTED_KEYWORD, JetTokens.INTERNAL_KEYWORD, JetTokens.PRIVATE_KEYWORD,
- JetTokens.OPEN_KEYWORD, JetTokens.FINAL_KEYWORD,
+ JetTokens.OPEN_KEYWORD, JetTokens.FINAL_KEYWORD, JetTokens.ABSTRACT_KEYWORD, JetTokens.SEALED_KEYWORD,
JetTokens.OVERRIDE_KEYWORD)
fun parseDocumentation(descriptor: DeclarationDescriptor): Content {
diff --git a/test/data/classes/sealedClass.kt b/test/data/classes/sealedClass.kt
new file mode 100644
index 00000000..93350393
--- /dev/null
+++ b/test/data/classes/sealedClass.kt
@@ -0,0 +1 @@
+sealed class Foo() {}
diff --git a/test/src/model/ClassTest.kt b/test/src/model/ClassTest.kt
index bcedf49c..8c3adb7f 100644
--- a/test/src/model/ClassTest.kt
+++ b/test/src/model/ClassTest.kt
@@ -169,6 +169,13 @@ public class ClassTest {
}
}
+ @Test fun sealedClass() {
+ verifyPackageMember("test/data/classes/sealedClass.kt") { cls ->
+ val modifiers = cls.details(DocumentationNode.Kind.Modifier).map { it.name }
+ assertEquals(1, modifiers.count { it == "sealed" })
+ }
+ }
+
Test fun annotatedClassWithAnnotationParameters() {
verifyModel("test/data/classes/annotatedClassWithAnnotationParameters.kt") { model ->
with(model.members.single().members.single()) {