Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

Custom kotlin plugin error: loader constraint violation #84

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

Custom kotlin plugin error: loader constraint violation #84

Evgen1000end opened this issue Jun 29, 2016 · 0 comments

Comments

@Evgen1000end
Copy link

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants