why cant you have a `suspend` and an `operator` fu...
# announcements
h
why cant you have a
suspend
and an
operator
fun?
p
because there is no suspendable operator to overload? 🤔
I miss declaring
suspend val/var
more 😃
h
I guess that makes sense
how come i can get a suspend operator plus function, but not a get one?
z
If by "get function" you mean property getter, in this reddit thread the kotlin language design lead says it's suspend properties have just not been implemented, but they might be at some point: https://www.reddit.com/r/Kotlin/comments/awkhlq/comment/ehn68vq This is a little confusing because the coroutines library already contains a suspend property (
coroutineContext
), but I'm guessing there are open questions that would need to be resolved before they want to allow third party code to implement them. Operator functions, however, are just syntactic sugar around regular functions so there aren't any separate edge cases to be considered from regular functions.
123 Views