KEEP
KEEP copied to clipboard
Opt-in into API implementation
This issue is for discussion of the proposal to introduce @SubclassOptInRequired
annotation in Kotlin to provide a mechanism to require opt-in for API implementation only.
Proposal PR https://github.com/Kotlin/KEEP/pull/319
This seems like it can be achieved today without adding new primitives:
interface DontSubclassMe {
@MyExperimentalApi
fun areYouSureYouWantToSubclassMe()
fun theRealMethods()
}
Any reason why OptInRequired
was used in the name instead of RequiresOptIn
? The latter seems to be more in line with the existing annotation. Suggestions:
-
SubclassRequiresOptIn
-
RequiresOptInForSubclass
- (
RequiresSubclassOptIn
)
The first two suggestions share the same term (RequiresOptIn
) with the existing annotation which is beneficial for code completion and using the same term also helps to remember the name.