New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom kotlin plugin error: loader constraint violation #84

Closed
Evgen1000end opened this Issue Jun 29, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@Evgen1000end

Evgen1000end commented Jun 29, 2016

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment