diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-06-23 13:09:09 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-06-24 10:47:42 +0200 |
commit | b7c4beec1b6317b1ceaf2520464996e9ee0e93e5 (patch) | |
tree | cc099aa8bec4cea1221aed5fe11f8e4da1bfec5c /core/src/main/kotlin/model | |
parent | 8a221a9084bf4fbc79b514c7f113fa2c4cb3dcfd (diff) | |
download | dokka-b7c4beec1b6317b1ceaf2520464996e9ee0e93e5.tar.gz dokka-b7c4beec1b6317b1ceaf2520464996e9ee0e93e5.tar.bz2 dokka-b7c4beec1b6317b1ceaf2520464996e9ee0e93e5.zip |
Make inherited functions and implemented intefaces source set dependent
Diffstat (limited to 'core/src/main/kotlin/model')
-rw-r--r-- | core/src/main/kotlin/model/documentableProperties.kt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/src/main/kotlin/model/documentableProperties.kt b/core/src/main/kotlin/model/documentableProperties.kt index 699a1df1..1a0c6303 100644 --- a/core/src/main/kotlin/model/documentableProperties.kt +++ b/core/src/main/kotlin/model/documentableProperties.kt @@ -4,11 +4,11 @@ import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.properties.ExtraProperty import org.jetbrains.dokka.model.properties.MergeStrategy -data class InheritedFunction(val inheritedFrom: DRI?): ExtraProperty<DFunction> { +data class InheritedFunction(val inheritedFrom: SourceSetDependent<DRI?>): ExtraProperty<DFunction> { companion object : ExtraProperty.Key<DFunction, InheritedFunction> { - override fun mergeStrategyFor(left: InheritedFunction, right: InheritedFunction) = MergeStrategy.Fail { - throw IllegalArgumentException("Function inheritance should be consistent!") - } + override fun mergeStrategyFor(left: InheritedFunction, right: InheritedFunction) = MergeStrategy.Replace( + InheritedFunction(left.inheritedFrom + right.inheritedFrom) + ) } val isInherited: Boolean @@ -17,11 +17,11 @@ data class InheritedFunction(val inheritedFrom: DRI?): ExtraProperty<DFunction> override val key: ExtraProperty.Key<DFunction, *> = InheritedFunction } -data class ImplementedInterfaces(val interfaces: List<DRI>): ExtraProperty<Documentable> { +data class ImplementedInterfaces(val interfaces: SourceSetDependent<List<DRI>>): ExtraProperty<Documentable> { companion object : ExtraProperty.Key<Documentable, ImplementedInterfaces> { - override fun mergeStrategyFor(left: ImplementedInterfaces, right: ImplementedInterfaces) = MergeStrategy.Fail { - throw IllegalArgumentException("Implemented interfaces should be consistent!") - } + override fun mergeStrategyFor(left: ImplementedInterfaces, right: ImplementedInterfaces) = MergeStrategy.Replace( + ImplementedInterfaces(left.interfaces + right.interfaces) + ) } override val key: ExtraProperty.Key<Documentable, *> = ImplementedInterfaces |