Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-goral authored and mergify-bot committed Jul 12, 2021
1 parent 90a8aeb commit 9139c7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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 =======================

Expand Down Expand Up @@ -47,4 +47,9 @@ internal fun <C : Parallel.Context> validator(
/**
* Factory function for creating dynamic [Parallel.Type].
*/
inline fun <reified T : Any> type(): Parallel.Type<T> = dynamicType(T::class.java)
inline fun <reified T : Any> type(): Parallel.Type<T> = type(T::class.java)

/**
* Factory function for creating dynamic [Parallel.Type].
*/
fun <T : Any> type(type: Class<T>): Parallel.Type<T> = DynamicType(type)
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package flank.exection.parallel.internal

import flank.exection.parallel.Parallel

internal fun <T : Any> dynamicType(type: Class<T>): Parallel.Type<T> = DynamicType(type)

internal class DynamicType<T : Any>(val type: Class<T>) : Parallel.Type<T> {
override fun equals(other: Any?): Boolean = (other as? DynamicType<*>)?.type == type
override fun hashCode(): Int = type.hashCode() + javaClass.hashCode()
Expand Down

0 comments on commit 9139c7e

Please sign in to comment.