According to the official documentation, *"SAM c...
# announcements
n
According to the official documentation, "SAM conversions only work for interfaces, not for abstract classes, even if those also have just a single abstract method." But I just tried it with an Abstract Class and it seems to work. Did I not understand the documentation properly or this is now possible in New Kotlin version? 🤔 https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
n
Hmm. Was your abstract class from Java or Kotlin? I think they meant that SAM conversions only work for kotlin interfaces (marked fun interface), but I think any single method class in Java can be used with SAM conversions.
n
It was in Kotlin, I tried it in the Kotlin Playground.
n
Link? I'm curious
n
I could have sworn that it worked the first time but maybe I probably got things mixed up. Because I just re-wrote it and it doesn't seem to work 😐🙁 https://pl.kotl.in/ESom5wOfd