looks like a possible known issue with kotlin's `U...
# android
w
looks like a possible known issue with kotlin's
Unit
, or rather Data Bindings ability to deal with it.
b
Yeah I’m starting to get the impression that it’s not possible (currently). Thanks for the link, maybe i should file an issue
Afaik, the workaround for this is just to pass a function that returns anything other than Unit (so
function: (View) -> Any
), not quite as clean but not a bad workaround
w
I'll be curious to see if that works for you. I haven't done too much in data binding myself.
b
Yep, it’s working for me after changing the return to
Any
. I can still use
Unit
, which makes it even weirder
Example:
Copy code
fun testFunction() = Unit
throws StackOverflowException, but
Copy code
fun testFunction(): Any = Unit
works fine
As far as I can tell. Still need to test more