Delegating to a var or function


#1

I can see there is some work to do in this area which is already captured under http://youtrack.jetbrains.com/issue/KT-1656.

Just wondered if, in the current version, there is any way to switch delegates dynamically? I have the following class declaration:

  public class ProxyEntry<T: Comparable<T>> private (var entry: Entry<T>): Entry<T> by entry

Modifying the ‘entry’ var after initialisation does not affect delegation as I was expecting…

Thanks, Alfie.


#2

No, this is not supported in the current version.