raquo / Airstream

State propagation and event streams with mandatory ownership and no glitches
MIT License
246 stars 28 forks source link

Var: batch set regression in 0.13 #90

Closed deterdw closed 2 years ago

deterdw commented 3 years ago

The documentation example for var batch set no longer works (since the vars have different types).

Laminar 0.12.2 works: https://scastie.scala-lang.org/wTlXRDIxSPS0EugsZcMa1w Laminar 0.13.0 doesn't work: https://scastie.scala-lang.org/IxxUzoreQwq7xK1wJI7OYg

raquo commented 3 years ago

Thanks for the report, I'm surprised our test suite didn't catch that, but it is a legit bug.

Looks like our Scala 3 migration made the Var.set and similar method signatures incorrect. Scala 3 is annoyingly incapable when it comes to existential types, so I'm not sure how exactly we'll fix that, but I did have a pretty comprehensive look at the options recently, so I'll pick the poison from what's available...

As a temporary workaround, you can use asInstanceOf to lie to Airstream that your VarTuple[Boolean] is actually VarTuple[Int] (or the other way).

--Nikita