The classes doc mentions the following rule. >...
# getting-started
s
The classes doc mentions the following rule.
If the constructor has annotations or visibility modifiers, the constructor keyword is required
I don't see it being followed in the Google sample.
Copy code
@Singleton
open class AppExecutors(
    private val diskIO: Executor,
    private val networkIO: Executor,
    private val mainThread: Executor
) {
What is going on here? https://github.com/googlesamples/android-architecture-components/blob/master/GithubBrowserSample/app/src/main/java/com/android/example/github/AppExecutors.kt#L35 https://kotlinlang.org/docs/reference/classes.html
b
The docs are talking about annotations / visibility modifiers that are applied to the constructor itself. In your example, the `val`s are marked as private, but the constructor is still public. If you wanted a private constructor, you would have to use
private constructor
.
The same would apply if for example you wanted to use the
@JvmOverloads
annotation, you would have to add the constructor keyword too
s
Oh okay. So it's annotations/visibility modifiers applied to the constructor. Thanks.
👍 1