Creating a member of type Private declaration without providing a definition is not only useless, but also not allowed by the compiler
scala> class Foo { private[this] type T }
<console>:11: error: abstract member may not have private modifier
class Foo { private[this] type T }
If you define a type member instead, then there may be some legitimate use cases.
Example: private type alias:
trait Foo {
private[this] type T = String
}
In this case, the type Texists only inside the class. This may be useful to provide a shorter name for the type in the implementation context only.
Another example: private renaming of a type parameter
trait Foo[Key] {
private[this] type K = Key
}
with roughly the same use case.
Making it secure can also make sense. Example:
trait Foo {
protected[this] type V
def foo(v: V): V
}
, , V, :
class Bar extends Foo {
type V = String
def foo(v: V): V = v
}