scalafiddle / scalafiddle-core

Source code for the scalafiddle.io compilation service
https://scalafiddle.io
Apache License 2.0
101 stars 37 forks source link

Linking error with Cats & Monix #37

Open markusa380 opened 5 years ago

markusa380 commented 5 years ago

See this fiddle for reference: https://scalafiddle.io/sf/c2qvSzI/0

The error:

ScalaFiddle.scala:-5: ERROR: There were linking errors
Referring to non-existent method cats.functor.Invariant.$$init$()scala.Unit
  called from monix.reactive.Observable$CatsInstances.()
  called from monix.reactive.Observable$.()
  called from ScalaFiddle$.()
  exported to JavaScript with @JSExport
Referring to non-existent method cats.functor.Invariant.$$init$()scala.Unit
  called from monix.eval.instances.CatsAsyncInstances$ForTask.()
  called from monix.eval.instances.CatsAsyncInstances$ForParallelTask.()
  called from monix.eval.instances.CatsEffectInstances$ForParallelTask.(monix.execution.Scheduler)
  called from monix.eval.TaskInstances2.catsEffectInstances(monix.eval.instances.ApplicativeStrategy,monix.execution.Scheduler)monix.eval.instances.CatsEffectInstances
  called from monix.eval.Task$.catsEffectInstances(monix.eval.instances.ApplicativeStrategy,monix.execution.Scheduler)monix.eval.instances.CatsEffectInstances
  called from ScalaFiddle$.()
  exported to JavaScript with @JSExport
involving instantiated classes:
  monix.eval.Task$
Referring to non-existent method cats.functor.Invariant.$$init$()scala.Unit
  called from cats.effect.IOInstances$$anon$1.(cats.effect.IOInstances)
  called from cats.effect.IOInstances.$$init$()scala.Unit
  called from cats.effect.IO$.()
  called from monix.eval.internal.TaskConversions$.fromEffect(java.lang.Object,cats.effect.Effect)monix.eval.Task
  called from monix.eval.Task$.fromEffect(java.lang.Object,cats.effect.Effect)monix.eval.Task
  called from monix.reactive.Observable.$$anonfun$mapEval$1(scala.Function1,cats.effect.Effect,java.lang.Object)monix.eval.Task
  called from monix.reactive.Observable.mapEval(scala.Function1,cats.effect.Effect)monix.reactive.Observable
  called from ScalaFiddle$.()
  exported to JavaScript with @JSExport
involving instantiated classes:
  monix.eval.internal.TaskConversions$
  monix.eval.Task$
  monix.reactive.internal.builders.IterableAsObservable
  monix.reactive.internal.operators.MapTaskObservable
  monix.reactive.internal.builders.NowObservable

I am unsure if that's ScalaFiddle's fault or not, but I currently have no way to confirm it in an IDE.

megri commented 5 years ago

I think it's a problem with library versions. If you use Cats 1.0-MF then it'll work (tick the box "show all versions" in the library selector):

https://scalafiddle.io/sf/VHtuiE6/0