Questions tagged [type-projection]

In the Scala language, a type projection `T#x` references the type member named `x` of type `T`.

According to §3.2.2 of the Scala language specification, a type projection T#x references the type member named x of type T. For example if there was a trait Animal { type Food }, then it is possible to refer to the type member Food using the projection Animal#Food. Unlike path-dependent types, this projection describes the Food type for any type of Animal, not a particular class or instance of Animal.

31 questions
-2
votes
4 answers

Kotlin star projection on contravariant types

I am reading and trying to understand Kotlin type projections, sometimes I come up with confusing things like this: For contravariant type parameters such as Consumer, a star projection is equivalent to . In effect, you can’t…
sunflower20
  • 389
  • 5
  • 14
1 2
3