The drawbacks of migrating to Kotlin
Benjamin Monjoie

Hey, thanks for the post. I really like these posts because it makes me aware of potential problems that I may have to spend hours to resolve.

But the statement about @StringRes annotation is a bit misleading. It is not Kotlin complaining at all. It is the Android lint that does not understand the Kotlin code. I think you should open a bug ticket to Android tools for that.

If you decompile the Kotlin bytecode you will see that the annotation is correctly put into the Java field, return type of the getter and the param of the setter. Just like how you would write it in Java.

Nice thing to say would be that we now defined it only once in Kotlin whereas in Java you would have to put the annotation 3 times.