Is there a shortcut for ``` var repeatMode: @Pl...
# getting-started
r
Is there a shortcut for
Copy code
var repeatMode: @Player.RepeatMode Int
        get() {
            return player.repeatMode
        }
        set(value) {
            player.repeatMode = value
        }
g
What about this?
Copy code
var repeatMode2: @Player.RepeatMode Int by player::repeatMode
💯 1
2
🤯 1
r
Neato
s
so tear-offs are instances of 'Delegate'!? Or just made into one if necessary? Or can 'by' handle Delegates and tear-offs?
g
It looks like kotlin compiler handles such cases. I wrote a simple example and it was optimised to good old getter and setter invokations (on JVM at least):
K 2