I'm trying to develop a small plugin that depends on the Scala plugin. The basics seem to be fine, I can call Scala plugin code, I can run the plugin etc. But there seems to be some classloading issues that I can't figure out. The problem occurs when calling following code:
val sc: ScObject...
sc.functions // throws!
The Error is: java.lang.LinkageError: loader constraint violation: when resolving interface method "org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTypeDefinition.functions()Lscala/Seq;" the class loader (instance of com/intellij/ide/plugins/cl/PluginClassLoader) of the current class, com/saynomoo/runner/ScalaRunnerProducer$$anonfun$locateRunnable$1, and the class loader (instance of com/intellij/ide/plugins/cl/PluginClassLoader) for resolved class, org/jetbrains/plugins/scala/lang/psi/api/toplevel/typedef/ScTypeDefinition, have different Class objects for the type scala/Seq used in the signature
The problem sounds like I have two different versions of scala library classes in the classpath. I have tried using 2.7.1.final and 2.7.2.RC3. I'm not 100% sure how to set up the project dependencies in the first place, I have added the scala plugin dependencies (Scala.jar) in the SDK part, since there were some classloading issues if i defined the dependency as a normal (deployable) module dependency.
Any suggestions are welcome,