mkrussel
02/02/2023, 8:43 PMBig Chungus
02/02/2023, 10:34 PMBig Chungus
02/02/2023, 10:35 PMBig Chungus
02/02/2023, 10:35 PMmkrussel
02/03/2023, 1:19 PM@get:MainThread
final override var isDisposed: Boolean = false
private set
Big Chungus
02/03/2023, 1:20 PMIgnat Beresnev
02/04/2023, 1:04 PMIgnat Beresnev
02/04/2023, 1:19 PMBig Chungus
02/04/2023, 1:20 PMilya.gorbunov
02/04/2023, 7:48 PMIt's sort of an implementation detail, but it might be important for the API reference reader,It's important for those who are gonna inherit from this class. A protected setter is equally important as any other protected member.
Ignat Beresnev
02/04/2023, 8:38 PMIt's important for those who are gonna inherit from this class.
A protected setter is equally important as any other protected member.For sure, I don't think anyone is denying that. With the current UI and layout of Dokka, it's impossible to satisfy two use cases: those who just use whatever classes they see, and those who want to inherit from them. One of the parties is going to be confused. If you see the signature from the screenshot below, you will go and try to change it from your code and find out that you cannot, because there's no way you can actually access the setter.
Foo
doesn't even have to be sealed, you can have a protected setter in a final class. And Dokka doesn't document protected API by default, so should we even consider the protected setter in this case? Anyhow, you'll be displeased
sealed class Foo {
var prop: String = "prop"
protected set
}
class Inheriting : Foo()
Similarly, if you're looking for a solution to change something in a framework you're using (like Spring in which there's a lot "configure through inheritance"), you'll see the val
and think that it's not mutable, and go look for another solution and waste time. But you actually could change it through inheritance if you knew. You'll also be displeasedilya.gorbunov
02/04/2023, 8:39 PMprotected set
should be shown as a part of var
property signatureilya.gorbunov
02/04/2023, 8:40 PMIgnat Beresnev
02/04/2023, 9:03 PMprovided that the protected is included in documented visibilitiesIf only public signatures are documented, should it be a
val
then, not a var
? One one hand, if the library author doesn't want you to see protected api, it should be a val
. On the other, Dokka will be lying in this case, maybe the library author is not against you inheriting and changing things.
For the HTML format, there could be additional hover tooltips or some visual indicators to help with it though.
Anyhow, the bug with private setters should definitely be fixed and I think it can be done quickly, but with protected/internal setters it'll most likely be in the backlog for some time and need additional research and discussion.Ignat Beresnev
02/04/2023, 9:08 PMvar
with a protected setter, which will be documented if documentedVisibilities == public, protected
. De jure you cannot change it because you cannot inherit from this class, so this information is useless to you, but if we display val
- Dokka will be lying in a senseilya.gorbunov
02/04/2023, 9:08 PMIgnat Beresnev
02/04/2023, 9:25 PMilya.gorbunov
02/05/2023, 1:19 AM