ThoughtWorksInc / Binding.scala

Reactive data-binding for Scala
https://javadoc.io/page/com.thoughtworks.binding/binding_2.13/latest/com/thoughtworks/binding/index.html
MIT License
1.59k stars 108 forks source link

@fxml compilation error: type mismatch #137

Closed ajaychandran closed 5 years ago

ajaychandran commented 5 years ago

I am encountering the following error for the example on the Wiki.

[error] FxmlSample.scala:12:41: type mismatch;
[error]  found   : com.thoughtworks.binding.Binding[Unit]
[error]  required: com.thoughtworks.binding.Binding[javafx.scene.control.Label]
[error]     val scene: Binding[Scene] = <Scene><Label>Hello, World!</Label></Scene>
[error]                                         ^
[error] one error found

I am building against 2.12.8 with the following settings:

  .settings(libraryDependencies += "com.thoughtworks.binding" %% "binding" % "11.3.0")
  .settings(libraryDependencies += "com.thoughtworks.binding" %% "fxml" % "11.3.0")
  .settings(libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "1.1.1")
  .settings(addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full))

What am I missing?

ajaychandran commented 5 years ago

I upgraded the library to 11.6.0 and the error is gone!

Atry commented 5 years ago

Note that it's a bug in Scala compiler, checkout https://github.com/scala/bug/issues/11293

We provide some workarounds for this bug in latest Binding.scala

ajaychandran commented 5 years ago

Thanks for the info!