https://kotlinlang.org logo
#announcements
Title
# announcements
d

deviant

05/21/2017, 2:02 PM
guys, is there known bug with
provideDelegate
operator? It's just not being called when i'm trying to instantiate delegate via helper function, such
Copy code
fun <T> observableField(default: T? = null): ReadWriteProperty<Observable, T?> = ObservableFieldProperty(default)
the operator works ok though when i instantiate delegated property directly with class constructor
1
youtrack 1
this is due to my function returns ReadWriteProperty and seems like it erases the operator or something like that. when i switched to
ObservableFieldProperty
as return type, all seems to work now.
i

ilya.gorbunov

05/21/2017, 5:25 PM
provideDelegate
is resolved statically, so the type must have it either as a member or as an extension.
☝️ 2