I have a quick question: how can I make is this po...
# announcements
g
I have a quick question: how can I make is this possible ? The code compile only if I change the naming of each naming, which I do not want
Copy code
private fun runTasks (gradleLambda: (ProjectConnection) -> List<GradleTask>) { ... }
private fun runTasks (gradleLambda: (ProjectConnection) -> String) { ... }
y
@JvmName
p
java cannot overload based on return signature
but using JvmName should change the compiled method name, so...
y
Yeah, I think lambda are compiled as
Function<>
(or its variants depending on parameters count) with type parameters for parameters/return type, so you lose this with type erasure
a
Copy code
@JvmName
gona fix that
g
thx guys!