I'm getting a Platform declaration clash even with
@OverloadResolutionByLambdaReturnType
for these functions
Platform declaration clash: The following declarations have the same JVM signature (generateListing(Ljava/lang/Integer;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Ljava/util/Iterator;):
fun generateListing(maxAmount: Int? = ..., after: String? = ..., func: (String?) -> CommitList): Iterator<Commit> defined in lakefs
fun generateListing(maxAmount: Int? = ..., after: String? = ..., func: (String?) -> DiffList): Iterator<Diff> defined in lakefs
fun generateListing(maxAmount: Int? = ..., after: String? = ..., func: (String?) -> ObjectStatsList): Iterator<ObjectStats> defined in lakefs
fun generateListing(maxAmount: Int? = ..., after: String? = ..., func: (String?) -> RefList): Iterator<Ref> defined in lakefs
Why? Shouldn't this work?
h
hfhbd
02/25/2024, 11:02 AM
The return type isn’t part of the Java function signature.
hfhbd
02/25/2024, 11:12 AM
Technically Kotlin could add the return type to the Kotlin function signature (ignoring the problematic case when calling without a assignment) and could generate valid JVM byte code but you will loose Java interop so it is not implemented (and possibly never will). As a workaround use JvmName