Any other way of marking internal APIs in interfac...
# getting-started
m
Any other way of marking internal APIs in interfaces?
Copy code
interface IFoo {
    @Suppress("DEPRECATION")
    @RequiresOptIn(
        level = RequiresOptIn.Level.ERROR,
        message = "This API is DANGEROUS, internal and should not be used. It could be removed or changed without notice."
    )
    @Experimental(level = Experimental.Level.ERROR)
    @Target(
        AnnotationTarget.PROPERTY
    )
    annotation class DangerousInternalAPI

    @DangerousInternalAPI
    val internalState: MutableMap<KType, Any>
m
That’s basically what the
internal
access modifier is for
m
Yes, but you can't make a method/field internal in an interface
m
what about defining a separate internal interface?
m
Thought about that, but I need to make inline methods on the public interface to use refined and they need access to the internal interface, so I end right back where I started 😢
Or maybe I am missing something 🙂
m
maybe this shouldn’t be an interface at all, considering the amount of implementation it’s offering