japgolly / scalajs-react

Facebook's React on Scala.JS
https://japgolly.github.io/scalajs-react/
Apache License 2.0
1.64k stars 232 forks source link

MonocleReact doesn't work with polymorphics optics #235

Closed japgolly closed 8 years ago

japgolly commented 8 years ago
[error] /home/golly/projects/scalajs-benchmark/benchmark/src/main/scala/japgolly/scalajs/benchmark/gui/SuiteComp.scala:337: no type parameters for method setStateL: (l: L[japgolly.scalajs.benchmark.gui.SuiteComp.State[P], japgolly.scalajs.benchmark.gui.SuiteComp.State[P], _, B])(b: B, cb: japgolly.scalajs.react.Callback)(implicit L: japgolly.scalajs.react.SetterMonocle[L])japgolly.scalajs.react.Callback exist so that it can be applied to arguments (monocle.Lens[japgolly.scalajs.benchmark.gui.SuiteComp.State[Nothing],Option[String]])
[error]  --- because ---
[error] argument expression's type is not compatible with formal parameter type;
[error]  found   : monocle.Lens[japgolly.scalajs.benchmark.gui.SuiteComp.State[Nothing],Option[String]]
[error]     (which expands to)  monocle.PLens[japgolly.scalajs.benchmark.gui.SuiteComp.State[Nothing],japgolly.scalajs.benchmark.gui.SuiteComp.State[Nothing],Option[String],Option[String]]
[error]  required: ?L[japgolly.scalajs.benchmark.gui.SuiteComp.State[P], japgolly.scalajs.benchmark.gui.SuiteComp.State[P], _$1, ?B] forSome { type _$1 }
[error]         _ <- $.setStateL(State.oldTitle)(Some(t))
[error]                ^
[error] /home/golly/projects/scalajs-benchmark/benchmark/src/main/scala/japgolly/scalajs/benchmark/gui/SuiteComp.scala:337: type mismatch;
[error]  found   : monocle.Lens[japgolly.scalajs.benchmark.gui.SuiteComp.State[Nothing],Option[String]]
[error]     (which expands to)  monocle.PLens[japgolly.scalajs.benchmark.gui.SuiteComp.State[Nothing],japgolly.scalajs.benchmark.gui.SuiteComp.State[Nothing],Option[String],Option[String]]
[error]  required: L[japgolly.scalajs.benchmark.gui.SuiteComp.State[P], japgolly.scalajs.benchmark.gui.SuiteComp.State[P], _, B]
[error]         _ <- $.setStateL(State.oldTitle)(Some(t))
japgolly commented 8 years ago

It does as confirmed by new test - Scala's type inference is just shit as usual.