A protected member is visible inside its containing class and its subclasses, but not to unrelated callers or same-package code. Kotlin deliberately differs from Java here: package membership does not grant protected access. section 4.1.3
Subclass access, extension rejection
open class TalkativeButton { protected fun whisper() = println("Let's talk!") } class Child : TalkativeButton() { fun speak() = whisper() // allowed } fun TalkativeButton.giveSpeech() { whisper() // error: extensions gain no protected access } section 4.1.3
Table 4.2 Kotlin visibility modifiers (view table figure)
Use the visibility table to compare protected with public, internal, and private declarations, including its absence for top-level declarations. section 4.1.3



