aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin
diff options
context:
space:
mode:
authorPaweł Marks <pmarks@virtuslab.com>2020-02-27 18:10:57 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-03-04 14:28:14 +0100
commitded94108b225686bc77ec1626798ded06a6db0c1 (patch)
tree6be36e8e4c65928e8726a53ca3410dd7f90deb90 /core/src/main/kotlin
parent10874a53b0db00c45d4ab44dfd226672dcf75115 (diff)
downloaddokka-ded94108b225686bc77ec1626798ded06a6db0c1.tar.gz
dokka-ded94108b225686bc77ec1626798ded06a6db0c1.tar.bz2
dokka-ded94108b225686bc77ec1626798ded06a6db0c1.zip
Small cleanup in the model
- modifier made not nullable - redundant companions moved out from children lists
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r--core/src/main/kotlin/model/Documentable.kt12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt
index 4190edc3..aeb10bee 100644
--- a/core/src/main/kotlin/model/Documentable.kt
+++ b/core/src/main/kotlin/model/Documentable.kt
@@ -72,7 +72,7 @@ interface WithType {
}
interface WithAbstraction {
- val modifier: Modifier?
+ val modifier: Modifier
enum class Modifier {
Abstract, Open, Final, Sealed, Empty
@@ -145,7 +145,7 @@ data class Class(
override val generics: List<TypeParameter>,
override val supertypes: PlatformDependent<List<DRI>>,
override val documentation: PlatformDependent<DocumentationNode>,
- override val modifier: WithAbstraction.Modifier?,
+ override val modifier: WithAbstraction.Modifier,
override val platformData: List<PlatformData>,
override val extra: PropertyContainer<Class> = PropertyContainer.empty()
) : Classlike(), WithAbstraction, WithCompanion, WithConstructors, WithGenerics, WithSupertypes,
@@ -174,7 +174,7 @@ data class Enum(
override val extra: PropertyContainer<Enum> = PropertyContainer.empty()
) : Classlike(), WithCompanion, WithConstructors, WithSupertypes, WithExtraProperties<Enum> {
override val children: List<Documentable>
- get() = (entries + functions + properties + classlikes + listOfNotNull(companion) + constructors) as List<Documentable>
+ get() = (entries + functions + properties + classlikes + constructors) as List<Documentable>
override fun withNewExtras(newExtras: PropertyContainer<Enum>) = copy(extra = newExtras)
}
@@ -206,7 +206,7 @@ data class Function(
override val type: TypeWrapper,
override val generics: List<TypeParameter>,
override val receiver: Parameter?,
- override val modifier: WithAbstraction.Modifier?,
+ override val modifier: WithAbstraction.Modifier,
override val platformData: List<PlatformData>,
override val extra: PropertyContainer<Function> = PropertyContainer.empty()
) : Documentable(), Callable, WithGenerics, WithExtraProperties<Function> {
@@ -271,7 +271,7 @@ data class Annotation(
override val extra: PropertyContainer<Annotation> = PropertyContainer.empty()
) : Classlike(), WithCompanion, WithConstructors, WithExtraProperties<Annotation> {
override val children: List<Documentable>
- get() = (functions + properties + classlikes + constructors + listOfNotNull(companion)) as List<Documentable>
+ get() = (functions + properties + classlikes + constructors) as List<Documentable>
override fun withNewExtras(newExtras: PropertyContainer<Annotation>) = copy(extra = newExtras)
}
@@ -286,7 +286,7 @@ data class Property(
override val receiver: Parameter?,
val setter: Function?,
val getter: Function?,
- override val modifier: WithAbstraction.Modifier?,
+ override val modifier: WithAbstraction.Modifier,
override val platformData: List<PlatformData>,
override val extra: PropertyContainer<Property> = PropertyContainer.empty()
) : Documentable(), Callable, WithExtraProperties<Property> {