Scala notation | Meaning | Remarks |
---|---|---|
[+T] | Only subclass may be used | Covariant |
[-T] | Only superclass may be used | Contravariant |
[T] | Only specified type may be used | Invariant |
[X <: B] | Declares that type variable X refers to a subtype of type B | Upper type bounds |
[X >: B] | Declares that type variable X refers to a supertype of type B | Lower type bounds |
Remarks:
- Supertype - parent type
- Subtype - child type
See code examples on Git
No comments:
Post a Comment