From 9139c7e31ce6d1372bfd220980bfef7cd3bbcadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janek=20G=C3=B3ral?= Date: Mon, 12 Jul 2021 10:08:40 +0200 Subject: [PATCH] Fix --- .../src/main/kotlin/flank/exection/parallel/Create.kt | 9 +++++++-- .../main/kotlin/flank/exection/parallel/internal/Type.kt | 2 -- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tool/execution/parallel/src/main/kotlin/flank/exection/parallel/Create.kt b/tool/execution/parallel/src/main/kotlin/flank/exection/parallel/Create.kt index 7856b3d29f..36cdcc7dff 100644 --- a/tool/execution/parallel/src/main/kotlin/flank/exection/parallel/Create.kt +++ b/tool/execution/parallel/src/main/kotlin/flank/exection/parallel/Create.kt @@ -1,7 +1,7 @@ package flank.exection.parallel +import flank.exection.parallel.internal.DynamicType import flank.exection.parallel.internal.EagerProperties -import flank.exection.parallel.internal.dynamicType // ======================= Signature ======================= @@ -47,4 +47,9 @@ internal fun validator( /** * Factory function for creating dynamic [Parallel.Type]. */ -inline fun type(): Parallel.Type = dynamicType(T::class.java) +inline fun type(): Parallel.Type = type(T::class.java) + +/** + * Factory function for creating dynamic [Parallel.Type]. + */ +fun type(type: Class): Parallel.Type = DynamicType(type) diff --git a/tool/execution/parallel/src/main/kotlin/flank/exection/parallel/internal/Type.kt b/tool/execution/parallel/src/main/kotlin/flank/exection/parallel/internal/Type.kt index cdff23b174..e4d0a4c957 100644 --- a/tool/execution/parallel/src/main/kotlin/flank/exection/parallel/internal/Type.kt +++ b/tool/execution/parallel/src/main/kotlin/flank/exection/parallel/internal/Type.kt @@ -2,8 +2,6 @@ package flank.exection.parallel.internal import flank.exection.parallel.Parallel -internal fun dynamicType(type: Class): Parallel.Type = DynamicType(type) - internal class DynamicType(val type: Class) : Parallel.Type { override fun equals(other: Any?): Boolean = (other as? DynamicType<*>)?.type == type override fun hashCode(): Int = type.hashCode() + javaClass.hashCode()