From ded94108b225686bc77ec1626798ded06a6db0c1 Mon Sep 17 00:00:00 2001 From: Paweł Marks Date: Thu, 27 Feb 2020 18:10:57 +0100 Subject: Small cleanup in the model - modifier made not nullable - redundant companions moved out from children lists --- core/src/main/kotlin/model/Documentable.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'core/src') 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, override val supertypes: PlatformDependent>, override val documentation: PlatformDependent, - override val modifier: WithAbstraction.Modifier?, + override val modifier: WithAbstraction.Modifier, override val platformData: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : Classlike(), WithAbstraction, WithCompanion, WithConstructors, WithGenerics, WithSupertypes, @@ -174,7 +174,7 @@ data class Enum( override val extra: PropertyContainer = PropertyContainer.empty() ) : Classlike(), WithCompanion, WithConstructors, WithSupertypes, WithExtraProperties { override val children: List - get() = (entries + functions + properties + classlikes + listOfNotNull(companion) + constructors) as List + get() = (entries + functions + properties + classlikes + constructors) as List override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) } @@ -206,7 +206,7 @@ data class Function( override val type: TypeWrapper, override val generics: List, override val receiver: Parameter?, - override val modifier: WithAbstraction.Modifier?, + override val modifier: WithAbstraction.Modifier, override val platformData: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : Documentable(), Callable, WithGenerics, WithExtraProperties { @@ -271,7 +271,7 @@ data class Annotation( override val extra: PropertyContainer = PropertyContainer.empty() ) : Classlike(), WithCompanion, WithConstructors, WithExtraProperties { override val children: List - get() = (functions + properties + classlikes + constructors + listOfNotNull(companion)) as List + get() = (functions + properties + classlikes + constructors) as List override fun withNewExtras(newExtras: PropertyContainer) = 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, override val extra: PropertyContainer = PropertyContainer.empty() ) : Documentable(), Callable, WithExtraProperties { -- cgit