What about passing functions that conform to some ...
# announcements
a
What about passing functions that conform to some interface, let’s say for converting values?
Copy code
@Json(parser = ::fromJson, serializer = ::toJson)
val body: Body
In Java it would require separate classes for
parser
and
serializer
or one super class. With Kotlin we can write functions outside of classes. Can’t imagine very useful appliance at the moment. But that doesn’t mean somebody wouldn’t create something wonderfully mind-blowing with such api. Like APT became really popular only after n years after release.