In Scala, type parameters and abstract types may be constrained by a type bound. Such type bounds limit the concrete values of the type variables and possibly reveal more information about the members of such types. An upper type bound T <: A
declares that type variable T
refers to a subtype of type A
.
Here is an example that demonstrates upper type bound for a type parameter of class Cage
:
This is a companion discussion topic for the original entry at http://docs.scala-lang.org//tutorials/tour/upper-type-bounds.html.html