https://kotlinlang.org logo
#coroutines
Title
# coroutines
j

johnaqel

01/20/2021, 2:16 AM
Has there been any recent talk of suspend getters/setters for properties? I would really love to see this. Anyone know if it’s being planned?
s

spierce7

01/20/2021, 2:28 AM
I’m sure there is an issue on the kotlin bug tracker you could follow
v

Vsevolod Tolstopyatov [JB]

01/20/2021, 9:11 AM
https://youtrack.jetbrains.com/issue/KT-15555 here is the issue. In general, suspendable properties break our own style-guide regarding properties:
Copy code
Prefer a property over a function when the underlying algorithm:

- does not throw
- is cheap to calculate (or cached on the first run)
- returns the same result over invocations if the object state hasn't changed
So we are constantly postponing it in the favor of other language features and haven’t yet found enough resources to make a final decision to not support them or to support them
5 Views