You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.
open class ExampleTask: DefaultTask() {
var from:String = "default from value"
open fun lambdaExample(setup:(String)->String):String{
return setup(from)
}
@TaskAction
open fun send(){
val res = lambdaExample { "it = $it" }
println(res)
}
}
Call:
task < ExampleTask > ("overriding task"){
from = "new value"
val res = lambdaExample { "[$it]" }
}
Script not compile with error
Loader constraint violation: when resolving method "com.home.ExampleTask.lambdaExample(Lkotlin/jvm/functions/Function1;)Ljava/lang/String;" the class loader (instance of org/jetbrains/kotlin/codegen/GeneratedClassLoader) of the current class, Build_gradle$4, and the class loader (instance of org/gradle/internal/classloader/VisitableURLClassLoader) for the method's defining class, com.home.ExampleTask, have different Class objects for the type kotlin/jvm/functions/Function1 used in the signature
What am I doing wrong?
The text was updated successfully, but these errors were encountered:
i wrote plugin on Kotlin and i'm trying use it.
Plugin:
open class ExampleTask: DefaultTask() {
var from:String = "default from value"
open fun lambdaExample(setup:(String)->String):String{
return setup(from)
}
@TaskAction
open fun send(){
val res = lambdaExample { "it = $it" }
println(res)
}
}
Call:
task < ExampleTask > ("overriding task"){
from = "new value"
val res = lambdaExample { "[$it]" }
}
Script not compile with error
Loader constraint violation: when resolving method "com.home.ExampleTask.lambdaExample(Lkotlin/jvm/functions/Function1;)Ljava/lang/String;" the class loader (instance of org/jetbrains/kotlin/codegen/GeneratedClassLoader) of the current class, Build_gradle$4, and the class loader (instance of org/gradle/internal/classloader/VisitableURLClassLoader) for the method's defining class, com.home.ExampleTask, have different Class objects for the type kotlin/jvm/functions/Function1 used in the signature
What am I doing wrong?
The text was updated successfully, but these errors were encountered: