Can I not implement get/set declared in Java interface with a property?


#1

I have an interface declared in Java that declares standard getter and setter methods and I want to implement that interface in a Kotlin class. Can I not implement those methods using Kotlin properties? It appears not.

I saw a question here from a year ago and at the time you couldn’t, but at this stage not being able to do so seems very broken.


#2

Unfortunately, no. It would be very hard to support in a general case.


#3

The fact that you can call them as properties but not implement them as properties is confusing. And unfortunately it is a pain to implement because you have to create the get and set functions and add a backing property.


#4

I totally agree that it’s a pity, but I think that having them at least usable is better than nothing at all