aboutsummaryrefslogtreecommitdiff
path: root/plugins/kotlin-as-java/src/main
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-08-31 13:27:43 +0200
committerAndrzej Ratajczak <32793002+BarkingBad@users.noreply.github.com>2020-09-08 12:52:59 +0200
commit883408f0d12abfba88434b41cd8d752afc7ebf35 (patch)
treeec693ce8e071fe7defa3cd760c5e7234697e59a2 /plugins/kotlin-as-java/src/main
parent956e5ff3b21290d536b45f2a185f419416eb5554 (diff)
downloaddokka-883408f0d12abfba88434b41cd8d752afc7ebf35.tar.gz
dokka-883408f0d12abfba88434b41cd8d752afc7ebf35.tar.bz2
dokka-883408f0d12abfba88434b41cd8d752afc7ebf35.zip
Apply requested changes
Diffstat (limited to 'plugins/kotlin-as-java/src/main')
-rw-r--r--plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt b/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt
index 3fd9cf18..e0ac3c40 100644
--- a/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt
+++ b/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt
@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType
import java.lang.IllegalStateException
-private fun <T : WithExpectActual> List<T>.groupedByLocation() =
+private fun <T : WithSources> List<T>.groupedByLocation() =
map { it.sources to it }
.groupBy({ (location, _) ->
location.let {
@@ -25,7 +25,7 @@ private fun <T : WithExpectActual> List<T>.groupedByLocation() =
internal fun DPackage.asJava(): DPackage {
@Suppress("UNCHECKED_CAST")
- val syntheticClasses = ((properties + functions) as List<WithExpectActual>)
+ val syntheticClasses = ((properties + functions) as List<WithSources>)
.groupedByLocation()
.map { (syntheticClassName, nodes) ->
DClass(
@@ -50,6 +50,7 @@ internal fun DPackage.asJava(): DPackage {
documentation = emptyMap(),
modifier = sourceSets.map { it to JavaModifier.Final }.toMap(),
sourceSets = sourceSets,
+ isExpectActual = false,
extra = PropertyContainer.empty()
)
}
@@ -218,6 +219,7 @@ internal fun DObject.asJava(): DObject = copy(
receiver = null,
generics = emptyList(),
expectPresentInSet = expectPresentInSet,
+ isExpectActual = false,
extra = PropertyContainer.withAll(sourceSets.map {
mapOf(it to setOf(ExtraModifiers.JavaOnlyModifiers.Static)).toAdditionalModifiers()
})